Condition for the durability

1717347214471.png

===
Hi, i would like show the image when the durability is tot, someone know how is the script for it?
You should clarify this is for SRD HUDMaker (and whatever plugin you're using for durability). The answer depends on what plugin you're using for durability.
You should clarify this is for SRD HUDMaker (and whatever plugin you're using for durability). The answer depends on what plugin you're using for durability.
is using the Yanlfy one
I'm sorry, I don't understand your question.

Perhaps you can try typing complete sentences into Google translate or something, see if it helps communicate better.

The durability of what? What does "tot" mean?
Aaaand i wanted ask also, All the characters have 500HP base, but i wanted put the limit to 600 if the player use the HP boost, but not more than 600HP, let me do a example

The character have 500HP, if the player eat have 600HP, but if use a potion for increase the hp it don't increase cuz is already 600, how can i do?

I'm sorry, I don't understand your question.

Perhaps you can try typing complete sentences into Google translate or something, see if it helps communicate better.

The durability of what? What does "tot" mean?
Durability of weapon and tot i mean "x" "value" "number" (because each weapon with different tier have more durability, so for write without explain i wrote tot
tot i mean "x" "value" "number"
I still don't understand what that means. But if you don't care to try a translator to use sentences, that's fine.

The durability of an actor's weapon is
Code:
reference_to_actor.weapons()[0].durability
and its maximum durability is
Code:
DataManager.getBaseItem(reference_to_actor.weapons()[0]).durMax

Replace reference_to_actor with your reference to an actor - from $gameActors or their position in $gameParty or whatever you're doing.

Good luck!
I still don't understand what that means. But if you don't care to try a translator to use sentences, that's fine.

The durability of an actor's weapon is
Code:
reference_to_actor.weapons()[0].durability
and its maximum durability is
Code:
DataManager.getBaseItem(reference_to_actor.weapons()[0]).durMax

Replace reference_to_actor with your reference to an actor - from $gameActors or their position in $gameParty or whatever you're doing.

Good luck!
Google Translator :

I would like to know how to write the condition script to show the current durability of the weapon, for example in this case the symbol is blue so it should be seen when the durability of the weapon that the character is using is 500, if instead it is more or less than 500 the image will be another
Something like this?

JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability == 500;
Something like this?

JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability == 500;
Thaaanks u soo much

EDIT:
And if the if i want do something like this :

Durability Blue
- Start from 250 and finish to 200

Durability Green
- Start from 200 and change in red when reach 150

Is something like
Condition for show the image of Green durability
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 200;

Condition for show the image of Red durability
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 150;

Right?
You actually need to change it so the numbers don't overlap, as that'll cause multiple conditions to be true at the same time.

Blue would be:
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 250 && $gameParty.members()[0].weapons()[0].durability > 200;

Green would be:
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 200 && $gameParty.members()[0].weapons()[0].durability > 150;

Red would be:
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 150;

This is the method you'd apply for each color you want.
You actually need to change it so the numbers don't overlap, as that'll cause multiple conditions to be true at the same time.

Blue would be:
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 250 && $gameParty.members()[0].weapons()[0].durability > 200;

Green would be:
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 200 && $gameParty.members()[0].weapons()[0].durability > 150;

Red would be:
JavaScript:
Condition: $gameParty.members()[0].weapons()[0].durability <= 150;

This is the method you'd apply for each color you want.
1717775885617.png

Is correct this way for make the weapon unbreakable when reach durability 10 or have other way for made the weapon don't unequip when the durability is 0?
@BlackGoldSaw Ehy, i having a small issues, basically i have an item for repair the weapon, but it don't work during the battle, how can i fix this?
Place this Code in an Item's Notebox and replace 77 with whatever amount of durability you want to restore.
JavaScript:
<Target Weapon Durability: +77>
Place this Code in an Item's Notebox and replace 77 with whatever amount of durability you want to restore.
JavaScript:
<Target Weapon Durability: +77>
this will not increase also the max durability if the actual durability is the same amount of the max?
The description for the notetag makes no mention of restoring durability over the max. Only breaking if the value is negative and the durability hits 0. try it anyways

Besides. Being able to set a max durability would be almost pointless if the presented way to restore it ignored the max imo
Strange, it actually DOES restore durability over the max. I can't tell if that's an oversight or not. This had me stumped for awhile, but I believe I've figured out a solution.

"diff" is simply the name of the variable containing the target's durability info. You can rename it if you want.
"50" is the amount of durability the item restores. Replace ALL "50"s with whatever amount you want to restore.

JavaScript:
<Repair Durability: 50>
<Custom Target All Weapon Durability>
 diff = $gameParty.members()[target.index()].weapons()[0].durMax - $gameParty.members()[target.index()].weapons()[0].durability;
if (50 > diff) {
  value += diff;
 } else {
  value += 50;
}
</Custom Target All Weapon Durability>
Strange, it actually DOES restore durability over the max. I can't tell if that's an oversight or not. This had me stumped for awhile, but I believe I've figured out a solution.

"diff" is simply the name of the variable containing the target's durability info. You can rename it if you want.
"50" is the amount of durability the item restores. Replace ALL "50"s with whatever amount you want to restore.

JavaScript:
<Repair Durability: 50>
<Custom Target All Weapon Durability>
 diff = $gameParty.members()[target.index()].weapons()[0].durMax - $gameParty.members()[target.index()].weapons()[0].durability;
if (50 > diff) {
  value += diff;
 } else {
  value += 50;
}
</Custom Target All Weapon Durability>
Ok this looks work, aaand another thing, how can i made that if the weapon instead to remove from the equip when is broke, still equipped with 0 durability?
Add this Plugin and place it below YEP_X_ItemDurability.
Add this Plugin and place it below YEP_X_ItemDurability.
Sure, i will, thanks for the help 🙂
Add this Plugin and place it below YEP_X_ItemDurability.
1718819870680.png

u know also the formula for do damage in base the level of durability? like idk a multiplier

example x1.4 if is 60 durability
x.1.3 if is 40 durability
0 damage if have 0 durability etc etc

Original thread: https://forums.rpgmakerweb.com/threads/condition-for-the-durability.169211/