How would I do damage falloff for zandronum?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
swadley
Posts: 4
Joined: Sun May 08, 2022 11:01 pm
Operating System: Windows 10/8.1/8/201x 64-bit

How would I do damage falloff for zandronum?

Post by swadley »

all the things i can find for it require zscript, but I want my wad to be playable in zandronum.
User avatar
MFG38
Posts: 392
Joined: Sun Apr 14, 2019 8:26 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)
Location: Finland

Re: How would I do damage falloff for zandronum?

Post by MFG38 »

What exactly do you mean by "damage falloff"?
Doomax
Posts: 3
Joined: Tue Jun 28, 2022 6:51 pm

Re: How would I do damage falloff for zandronum?

Post by Doomax »

Damage falloff usually means that bullets deal less damage the further the distance they travel.

The damage "falls off" with range.

I have no idea how to do it in doom though.
User avatar
ramon.dexter
Posts: 1238
Joined: Tue Oct 20, 2015 12:50 pm
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How would I do damage falloff for zandronum?

Post by ramon.dexter »

I think its purely impossible with decorate. Sorry, but this is too sophisticated and needs access to data, which decorate doesnt have to.

Actually, there is action SetDamage(), but for zscript only.
Last edited by ramon.dexter on Thu Jun 30, 2022 4:14 am, edited 1 time in total.
User avatar
Dan_The_Noob
Posts: 493
Joined: Tue May 07, 2019 12:24 pm
Twitch ID: Dan_The_Noob
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: How would I do damage falloff for zandronum?

Post by Dan_The_Noob »

maybe some "fast projectile" hacky stuff?
probably wouldn't run great or be worth the effort.
User avatar
22alpha22
Posts: 276
Joined: Fri Feb 21, 2014 5:04 pm
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: How would I do damage falloff for zandronum?

Post by 22alpha22 »

ramon.dexter wrote:Actually, there is action SetDamage(), but for zscript only.

SetDamage should work for Decorate as well. Combine it with GetDistance and it should be possible to create a damage falloff effect using DECORATE only. However as I do not use Zandronum, I do not know if it has those two functions.

If either or both of those functions do not exist in Zandronum, it should be possible to still accomplish a damage falloff effect using a little help from ACS. Set your projectile or hitscan damage to zero and use A_Explode to deal the damage instead. Have A_Explode execute an ACS script to get the damage that should be dealt based on the projectile/puffs distance.

I'm so glad these DECORATE/ACS hacks are no longer needed in GZDoom. I will never use Zandronum as long it does not have ZScript support.

EDIT:
If Zandronum has the HITTRACER flag, you can use A_DamageTracer instead of A_Explode as another option.
User avatar
ramon.dexter
Posts: 1238
Joined: Tue Oct 20, 2015 12:50 pm
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How would I do damage falloff for zandronum?

Post by ramon.dexter »

22alpha22 wrote: However as I do not use Zandronum, I do not know if it has those two functions.


Since the function was exposed in zscript and not directly to decorate, I bet that Zandronum doesnt have this function, since Zandro even misses some decorate functions that gzdoom have.
This would work in decorate only in gzdoom. Not in zandronum.
phantombeta
Posts: 1971
Joined: Thu May 02, 2013 1:27 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: How would I do damage falloff for zandronum?

Post by phantombeta »

22alpha22 wrote:
ramon.dexter wrote:Actually, there is action SetDamage(), but for zscript only.

SetDamage should work for Decorate as well. Combine it with GetDistance and it should be possible to create a damage falloff effect using DECORATE only. However as I do not use Zandronum, I do not know if it has those two functions.

If either or both of those functions do not exist in Zandronum, it should be possible to still accomplish a damage falloff effect using a little help from ACS. Set your projectile or hitscan damage to zero and use A_Explode to deal the damage instead. Have A_Explode execute an ACS script to get the damage that should be dealt based on the projectile/puffs distance.

I'm so glad these DECORATE/ACS hacks are no longer needed in GZDoom. I will never use Zandronum as long it does not have ZScript support.

EDIT:
If Zandronum has the HITTRACER flag, you can use A_DamageTracer instead of A_Explode as another option.

You don't need any of that:

Code: Select all

actor Foo { 
    Projectile
    Damage (user_Damage)

    var int user_Damage;

    // do things that set user_Damage
}
User avatar
ramon.dexter
Posts: 1238
Joined: Tue Oct 20, 2015 12:50 pm
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How would I do damage falloff for zandronum?

Post by ramon.dexter »

Wait, this use of user vars is possible in decorate? :shock:

Return to “Scripting”