Damage per distance

Moderator: GZDoom Developers

User avatar
jpalomo
Posts: 772
Joined: Mon May 17, 2010 9:45 am

Re: Damage per distance

Post by jpalomo »

Xaser wrote:Why not suggest a feature to modify a projectile's damage value? That'd give all the flexibility one would really need.
This can already be done in ACS using [wiki]SetActorProperty[/wiki]. You can easily use ACS_ExecuteAlways (in decorate) in combination with SetActorProperty to modify the damage on the fly.
User avatar
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: Damage per distance

Post by NeuralStunner »

That changes the Random(1,8) damage multiplier though. It's useless for custom formulas.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: Damage per distance

Post by Blue Shadow »

I'm not a programmer nor do I know anything about ZDoom inner workings, so excuse my ignorance, but couldn't the [wiki]A_WolfAttack[/wiki]'s 'damage over distance' feature be adapted to other attacks?
User avatar
Spottswoode
Posts: 18
Joined: Tue Jan 17, 2012 8:41 pm

Re: Damage per distance

Post by Spottswoode »

It's possible but unlikely. A_WolfAttack is a hitscan attack, but there is code designed to affect distance in it. The parameters for that action are very specific, so changing the action to more open parameters is probably better than adapting the code.
:oops: I had completely forgotten about this though.....shame on me.
User avatar
Blox
Posts: 3728
Joined: Wed Sep 22, 2010 9:35 am
Location: Apathetic Limbo

Re: Damage per distance

Post by Blox »

This probably wouldn't work for hitscan, but wouldn't having a projectile start at x health, then do DamageThing(y) every z tics, then at death do A_Explode(Health,smallradius) work?
User avatar
Spottswoode
Posts: 18
Joined: Tue Jan 17, 2012 8:41 pm

Re: Damage per distance

Post by Spottswoode »

wildweasel wrote:I've been told that the Gyrojet is a real-world gun whose projectile accelerates the longer it is in flight, thus theoretically doing more damage if it flies farther.
Gyrojet firearms are actually rocket propelled projectiles. They have a much lower velocity than most of the new long range cartridges even at their max.
TheBladeRoden
Posts: 13
Joined: Thu Jan 20, 2011 10:33 pm

Re: Damage per distance

Post by TheBladeRoden »

NeuralStunner wrote: You can factor up current absolute velocity, and add/subtract to a user variable. ([wiki]Decorate Expressions[/wiki] and [wiki]A_SetUserVar[/wiki] will help you here.) Then, [wiki]A_Explode[/wiki] can be used to deal the actual damage, with the modified damage value passed to it. (The projectile itself can be set to (0) damage.)
How would you do that? I can only seem to put a number in the explosion amount
User avatar
rollingcrow
Posts: 733
Joined: Tue Mar 02, 2010 8:30 pm
Graphics Processor: nVidia with Vulkan support

Re: Damage per distance

Post by rollingcrow »

TheBladeRoden wrote:
NeuralStunner wrote: You can factor up current absolute velocity, and add/subtract to a user variable. ([wiki]Decorate Expressions[/wiki] and [wiki]A_SetUserVar[/wiki] will help you here.) Then, [wiki]A_Explode[/wiki] can be used to deal the actual damage, with the modified damage value passed to it. (The projectile itself can be set to (0) damage.)
How would you do that? I can only seem to put a number in the explosion amount
I think this will help you.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”