Question about damage randomization

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!)
Post Reply
Winterwings
Posts: 8
Joined: Fri Aug 19, 2022 6:51 am
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Question about damage randomization

Post by Winterwings »

Hey folks.

Curious if it would be possible to change the way weapon/monster damage randomization works.
What i'm looking for is a way to make it so there is a base amount of damage dealt plus a bonus random amount. (Anyone who modded Warcraft 3 will know what i'm talking about)

For example:
Let's say i want a pistol that does a base 10 damage + random between 1 and 5.

Is this possible and if so what's the most efficient way to accomplish it?
Ac!d
Posts: 348
Joined: Tue Apr 02, 2019 5:13 am

Re: Question about damage randomization

Post by Ac!d »

A_FireBullets

ex : A_FireBullets(0, 0, 1, 10+1*random(1,5), FBF_NORANDOM)
Winterwings
Posts: 8
Joined: Fri Aug 19, 2022 6:51 am
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Question about damage randomization

Post by Winterwings »

Much obliged.
Post Reply

Return to “Scripting”