Change the maximum distance to hit of a weapon?

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!)
hexaae
Posts: 6
Joined: Mon Dec 12, 2022 3:14 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Change the maximum distance to hit of a weapon?

Post by hexaae »

I'm a total noob in ZDoom modding, and I usually play with GZDoom.

Ok... I see this funny axe/brutalaxe new weapon in all these Brutal Doom mods... but the hit distance is way too long and unrealistic. How can I change that to be closer?
Is there a sort of "range=" property I can edit to achieve this?
Jarewill
 
 
Posts: 1787
Joined: Sun Jul 21, 2019 8:54 am

Re: Change the maximum distance to hit of a weapon?

Post by Jarewill »

That depends on what functions the weapon is using, without knowing that it's hard to say.
If it uses A_CustomPunch, then one of the function's parameters is responsible for range, the one after defining what puff it should use.
hexaae
Posts: 6
Joined: Mon Dec 12, 2022 3:14 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Change the maximum distance to hit of a weapon?

Post by hexaae »

Mmmh, seems to use A_CustomMIssile https://paste.sh/t4n7b5hf#SyX-6oIXmZqbv8vLQSHvdg1G
Jarewill
 
 
Posts: 1787
Joined: Sun Jul 21, 2019 8:54 am

Re: Change the maximum distance to hit of a weapon?

Post by Jarewill »

In this case you need to find the projectile that's being fired, in this case all of them seem to inherit from either AxeAttack or AltAxeAttack, and change its speed property to something lower.
hexaae
Posts: 6
Joined: Mon Dec 12, 2022 3:14 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Change the maximum distance to hit of a weapon?

Post by hexaae »

Jarewill wrote: Wed Dec 06, 2023 5:22 pm In this case you need to find the projectile that's being fired, in this case all of them seem to inherit from either AxeAttack or AltAxeAttack, and change its speed property to something lower.
Changing Speed changes impact fx distance (sparks etc. + metallic sound collision with walls) but will still hit the target at the same distance, without sound/sparks and only applying silently the decal when hits the wall...
Jarewill
 
 
Posts: 1787
Joined: Sun Jul 21, 2019 8:54 am

Re: Change the maximum distance to hit of a weapon?

Post by Jarewill »

Ah, apologies.
I didn't notice it at the time, but the weapon actually uses A_Saw for its attacks with a range of 120.
You would have to change that to something lower if you want to lower the range.
hexaae
Posts: 6
Joined: Mon Dec 12, 2022 3:14 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Change the maximum distance to hit of a weapon?

Post by hexaae »

Thank you!
Adjusting both "Speed" for "ACTOR AxeAttack: FastProjectile" and "A_Saw" range I was finally able to correct the hit-distance!

... I still need your help 🙏🏻 with punch replacement (again too long range) though. I tried hard to solve it by myself but I'm too noob 😣:
https://paste.sh/lmUmt9Ha#btysNtldDMAf8x50TY97JWo5
Seems to be a similar logic at "ACTOR KickAttackFist: FastProjectile {}" but changing speed alone there doesn't change the hit-distance or the special fx associated (smoke, sparkles...).
hexaae
Posts: 6
Joined: Mon Dec 12, 2022 3:14 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Change the maximum distance to hit of a weapon?

Post by hexaae »

Ok, I got it.
Solved also the Fist hit-distance adding/editing "Speed = nn" to:

Line 1440: ACTOR MeleeStrike1: KickAttackFist //*Berserk mode: left-right jab, uppercut, right hook, left-hook (quickmelee)
Line 1463: ACTOR MeleeStrike2: MeleeStrike1 //*Uppercut and right hook. Quickmelee left-hook.
Line 1522: ACTOR MeleeStrikeNormal: MeleeStrike1 //*Left-Right jab.

Return to “Scripting”