Armor dont protect after "repairing"

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.

Armor dont protect after "repairing"

Postby Apeirogon » Sat Mar 03, 2018 9:07 am

I create starting armor which give very little protections, but "repair" itself.
But after completely destroing such armor, and when it repair itself back, it stop allow any protections. This happens only with armor.savepercent and only if armor was depleted by attack, not taken from console.

Summon monya. Use only with budda cheats.
zscript.txt
You do not have the required permissions to view the files attached to this post.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Armor dont protect after "repairing"

Postby Graf Zahl » Sat Mar 03, 2018 9:15 am

Moving to the "scripting" forum.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Armor dont protect after "repairing"

Postby Apeirogon » Sat Mar 03, 2018 12:49 pm

I didnt express myself well. This definitely a bug.

Because after depleting, and adding to this depleted armor some numbers of "durability" in way
Code: Select allExpand view
      let first = Owner.FindInventory("BasicArmor", true); console.printf("assigned");
      if (first != null)
      {
         let armor = BasicArmor(first); console.printf("found");
         if (armor != null)
            {
               armor.amount += 1; console.printf("add");
            }
      }

armor dont work properly, if it using armor.savepercent property. It still exist in inventory, can be increased with armor bonus, but it dont absorb any damage.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Armor dont protect after "repairing"

Postby Kotti » Mon Mar 05, 2018 5:16 am

If I understand this correctly, depleted armor does not have any SavePercent. You are just adding to the amount but fail to validate the SavePercent setting. If you pick up some armor bonus while the armor has been depleted it will completely reinitialize the BasicArmor. You should do the same.
Kotti
 
Joined: 27 Dec 2016

Re: Armor dont protect after "repairing"

Postby Apeirogon » Mon Mar 05, 2018 7:25 am

But it work if armor use armor.maxfullabsorb, or how there name?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Armor dont protect after "repairing"

Postby Graf Zahl » Mon Mar 05, 2018 10:57 am

Sorry, it looks like my initial response got lost somehow.

I moved this to "Editing" because this isn't a bug. 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest