[ZSCRIPT]Damage on Custom Armor Set Help

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
Kan3x
Posts: 62
Joined: Tue Nov 08, 2022 4:19 pm

[ZSCRIPT]Damage on Custom Armor Set Help

Post by Kan3x »

Hello guys,

I have a custom armor set replacing the standard armor.
Every piece has its "save percent", "save amount" etc. and it (seems to) works just fine absorbing the damage and getting damaged, but I noticed one annoying thing:
When the damage is too low, the only armor piece that will absorbed and consequently damaged is the last piece that the player worn.

I tried to avoid it by having a random chance (based on the number of worn armor pieces) to skip the "absorption", hoping that it will let another armor piece to absorb the damage, but it doesn't clearly work like that.

So I wonder, is there a way to randomize the armor piece that will absorb the damage when the damage itself is too low to trigger the "absorption" on the other pieces too?

This is my AbsorbDamage() function for the armor set:
Spoiler:
Post Reply

Return to “Scripting”