SelfDamageFactor
Moderator: GZDoom Developers
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
SelfDamageFactor
I'd like it if the was the option for an actor to take modified damage from its own sources, whether linked to a damage type akin to DamageFactor or hooked into A_Explode, since that seems like the only way for an actor to actually damage itself while still being able to be the source of it.
The first use that comes to mind and my primary purpose is allowing explosive weapons to explode their users less than their targets, making point-blank blasts less lethal and explosive jumping less dumb. The opposite being done I could see also getting some use, punishing careless players with increased blowback damage.
The reason why just a standard DamageFactor is not enough is because other players' weapons would also be affected, which is what I'm trying to avoid.
The first use that comes to mind and my primary purpose is allowing explosive weapons to explode their users less than their targets, making point-blank blasts less lethal and explosive jumping less dumb. The opposite being done I could see also getting some use, punishing careless players with increased blowback damage.
The reason why just a standard DamageFactor is not enough is because other players' weapons would also be affected, which is what I'm trying to avoid.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: SelfDamageFactor
For explosive damage such a property already exists (RadiusDamageFactor).
For other things it's probably not so useful, considering that you can't easily damage yourself with projectiles and hitscans.
For other things it's probably not so useful, considering that you can't easily damage yourself with projectiles and hitscans.
- NeuralStunner
-
- Posts: 12326
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: SelfDamageFactor
Doesn't this apply to all radius damage, not just one's own?Graf Zahl wrote:For explosive damage such a property already exists (RadiusDamageFactor).
Re: SelfDamageFactor
This would be useful.
- GhostKillahZero
- Posts: 742
- Joined: Wed Nov 13, 2013 4:41 pm
- Location: 343 Industries Headquarters
- Contact:
Re: SelfDamageFactor
Really? In what way would this be useful? [wiki]A_Explode[/wiki] and falling damage might be the only two factors that you can damage yourself, I'd say no to this one.Rowsol wrote:This would be useful.
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: SelfDamageFactor
Well, I did specifically mention its use in A_Explode, and one of the ways I thought it could be implemented would be as a parameter to that. Currently the only mitigation to it is all or nothing, plus the nothing option doesn't allow explosion jumping and such. I imagine it's because setting hurtshooter to false excludes the firer from the explosion calculations entirely, rather than just nullifying the damage.GhostKillahZero wrote:Really? In what way would this be useful? [wiki]A_Explode[/wiki] and falling damage might be the only two factors that you can damage yourself, I'd say no to this one.Rowsol wrote:This would be useful.
Re: SelfDamageFactor
There's no workaround that covers exactly what this property is suggesting, since the primary draw of this would be (as stated in the OP) damagetype-independent resistance to one's own explosive attacks that doesn't affect any other targets.
Even though MUHMUHFLUH isn't a multiplayer-focused port (though it's making strides), the clearest illustration would be a rocket launcher that's meant to deal reduced damage to self but full damage to other players in deathmatch. Right now, either you can completely negate the damage with XF_HURTSOURCE turned off, or offer all players explosive resistance; you can't do something like make the shooter take quarter-damage and the rest of the players take full.
IMO, though, the most fitting way to implement this is on projectiles (probably renamed to ShooterDamageFactor or somesuch since the definition "self" breaks down) or (probably better) as an additional A_Explode parameter. As mentioned, the only other "self damage" concept (that I can think of) is falling damage, which can already be adjusted with DamageFactor. Putting the new feature on the projectile or function call offers maximum flexibility.
Even though MUHMUHFLUH isn't a multiplayer-focused port (though it's making strides), the clearest illustration would be a rocket launcher that's meant to deal reduced damage to self but full damage to other players in deathmatch. Right now, either you can completely negate the damage with XF_HURTSOURCE turned off, or offer all players explosive resistance; you can't do something like make the shooter take quarter-damage and the rest of the players take full.
IMO, though, the most fitting way to implement this is on projectiles (probably renamed to ShooterDamageFactor or somesuch since the definition "self" breaks down) or (probably better) as an additional A_Explode parameter. As mentioned, the only other "self damage" concept (that I can think of) is falling damage, which can already be adjusted with DamageFactor. Putting the new feature on the projectile or function call offers maximum flexibility.
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: SelfDamageFactor
As an aside, I'm not even sure if falling damage is sourced by the inflictee. It wouldn't surprise me if it's dealt by the world, like sector damage.
Re: SelfDamageFactor
It's handled by the player themselves. It's treated as a suicide condition.
Re: SelfDamageFactor
Yea, the XF_HURTSOURCE part of A_Explode could just allow for other numbers between 0 and 1 to accomplish this effect.
Re: SelfDamageFactor
That's not how bit flags work.
Last edited by edward850 on Sat Feb 07, 2015 10:38 pm, edited 1 time in total.
Re: SelfDamageFactor
That's not how flags work.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: SelfDamageFactor
added