making an armor repair

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

making an armor repair

Post by ramon.dexter »

So, I want to make an item, that repairs armor. But not classic hacky actor, that simply gives ArmorBonus actors. I want something cleaner.

So, I have this mechanic in mind, but dont know how to make it work in zscript:

1. check for player's armor saveamount
2. check for actual armor level
3 . add the difference value to armor saveamount

How do I do that?
User avatar
Apeirogon
Posts: 1606
Joined: Mon Jun 12, 2017 12:57 am

Re: making an armor repair

Post by Apeirogon »

viewtopic.php?f=122&t=59663&hilit=armor

But
Graf Zahl wrote:You are not supposed to manipulate the BasicArmor item yourself, the expected mode of operation is that it gets replenished by BasicArmorPickup and BasicArmorBonus items.
Sou you firstly need to check
if(armor amount <=0){return;}

Return to “Scripting”