Make sure you have an equip in the second slot (default shield slot).
Without proper checks, the engine will throw an error if you check for equipment that is not there.
You can also try
$gameParty.members()[0].equips[0].durability
for and equip in the first slot.
Maliki's Item Durability EX ver 1.9
● ARCHIVED · READ-ONLY
-
-
Make sure you have an equip in the second slot (default shield slot).
Without proper checks, the engine will throw an error if you check for equipment that is not there.
You can also try
$gameParty.members()[0].equips[0].durability
for and equip in the first slot.
Strange still the same error.
$gameParty.totalDurability(); works without problem and returns the correct value but
$gameParty.members()[0].equips[0].durability still complains about the undefined durability.
Like so:
SCRIPT CALL ERROR
17:21:59.699 YEP_EquipCore.js:1146 $gameParty.members()[0].equips[0].durability
17:21:59.700 YEP_EquipCore.js:1147 TypeError: Cannot read property 'durability' of undefined
at eval (eval at Game_Interpreter.command355 (YEP_CoreEngine.js:1852), <anonymous>:1:34)
at Game_Interpreter.command355 (YEP_CoreEngine.js:1852)
at Game_Interpreter.executeCommand (rpg_objects.js:8930)
at Game_Interpreter.update (rpg_objects.js:8838)
at Game_Troop.updateInterpreter (rpg_objects.js:5226)
at Function.BattleManager.updateEventMain (rpg_managers.js:2281)
at Function.BattleManager.updateEvent (YEP_BattleEngineCore.js:1962)
at Function.BattleManager.update (YEP_BattleEngineCore.js:1920)
at Scene_Battle.updateBattleProcess (rpg_scenes.js:2265)
at Scene_Battle.update (rpg_scenes.js:2257) -
When do you get the error exactly?
Ans when do you make the call? -
I am using a skill during combat that activates a common event.
The common event is as follows:
◆Control Variables:#0023 Durability = $gameParty.members()[0].equips[0].durability
◆Text:None, Window, Bottom
:Text:\V[23]
$gameParty.totalDurability(); works using this common event and returns the correct value as text
but $gameParty.members()[0].equips[0].durability does not. -
Found it!I am using a skill during combat that activates a common event.
The common event is as follows:
◆Control Variables:#0023 Durability = $gameParty.members()[0].equips[0].durability
◆Text:None, Window, Bottom
:Text:\V[23]
$gameParty.totalDurability(); works using this common event and returns the correct value as text
but $gameParty.members()[0].equips[0].durability does not.
Try this:
$gameParty.members()[0].equips()[0].durability
(Note you have to put() at the end of equips.)
Let me know if that helped. -
Brilliant! Works like a charm now!
Thank you so much!
Hope this will help other people to avoid major headaches that this missing () caused me haha. -
Small But hopefully useful update to 1.7.
Now allows Max Durability to be changed.
(Unbreakable items cannot be changed from that and breakables cannot have less than 1 point of max durability.) -
@Maliki79 I had an idea regarding the use of extra stats because of this plugin I'm using. https://forums.rpgmakerweb.com/inde...dditional-stats-for-actors-and-enemies.60213/
Is it manageable for the ItemDurability plugin to apply a state to a weapon / armor as soon as it's broken, through note tags?
I'm using Number 1 of the Durability where they may continue using their weapons and armor even if broken. The weapon I've done has a custom stat that provides additional attack power , but at the same time, I can add or subtract its amount through passive states.
For example, I have an Actor with 30 base Attack Power and is equipped with a weapon with 10 Might ("mt" custom stat), but if that weapon was broken, a state would be applied doing whatever code is set there (whether custom stats, usual power-up scripts, etc.). -
Updated to version 1.8.
Added Script calls that can be used for conditionals.
@RK DracoRoy , you can use the conditionals to set up a Passive State using YF's Auto Passives plugin, etc to likely do what you need.
And if you simply want to apply the state with no other bells or whistles, YF's Dur Plugin already has a Lunatic section for calling code when an item breaks.
<Custom Break Effect>
user.addState(x);
</Custom Break Effect>
in the weapon notes SHOULD do what you need it to.
Didn't test it myself tho. -
@Maliki79 Okay, thank you! I'm getting closer to what I need here, with Victor's Passive States.
However, I've one problem:
It's working when I first start the game and so I go into battle, but when the weapon breaks, the provided scriptcalls for Weapon / Armor break don't update on the passive states, strangely. It's not a conflict on his plugin as many conditions I've been using conditions work, but it may be the two scriptcalls.
If I start the game with this, the passive state will show but the scriptcall won't update to turn off the state if the weapon's broken.
<custom passive state: 106>
result = !a.isWeaponBroken(1);
</custom passive state>
If I start the game with this, the passive state won't show but the scriptcall won't update to turn on the state if it's broken.
<custom passive state: 106>
result = a.isWeaponBroken(1);
</custom passive state>
--------
This happens only when I have Durability System set to "1" to keep the broken weapon.
-----------
EDIT: Can confirm it happens not just on Passive States when first starting the game, but anywhere else that checks the scriptcalls without updating or refreshing in case conditions aren't met. -
Try formatting it like this:
<Custom Passive Condition>
if (user.isWeaponBroken(1) ){
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
I don't use passive state plugins myself so I am going by what is on the website. -
It's not the Passive States plugin or the format, but the two conditional scriptcalls from the plugin don't seem to update or refresh.
-----------------------------------------
Game_Actor.isWeaponBroken(type);
Game_Actor.isArmorBroken(type);
-----------------------------------------
I've tested them in other instances outside passive states themselves, and realized it's the scriptcalls themselves not updating. -
Found the error!
Please redownload and try again.
Thx -
Yes! All set with this now!
-
Hey! :)
I’m trying to make FFVII Remake - Revival Earrings -revives a player once Hp hits 0 then the earrings will break and remove from equip. Yanfly does have a video called Phoenix ring, but this didn’t work for me as the earrings didn’t remove. I’ve tested with durability plugin and it does work and remove the earrings after x durability, but wondering if it is possible with this plugin to force break an armors durability ( once it revives the player )
Many thanks -
Hmmm... There is a script call to do direct durability damage to an item, but it may be hard to find the item when making the call from a skill.
Instead, I think I'll try something else.
Gimme some time. I'm on it.
EDIT: I think I found a solution (The one I originally came up with will take some time to implement.)
I don't know how you refer to your actor when using the earrings, but you can try:
actor.durabilityBreakItem(actor.equips()[4]);
assuming the earrings are in the accessory slot.
(If you use different syntax, let me know and I'll try to adjust the call.)
Also, note that I had to make a small update to the plugin so this call made by users wouldn't cause any weird effects.
So DL the updated plugin before trying this. -
Hi @Maliki79
Hope you are well.
First of all thank you for this great plugin. I initially scrapped durability completely from my game but with this fantastic add on its back in.
Not sure if you still checking this thread but I was wondering if you could give a short example as how to utilize the script calls together to have the "Blacksmith" charge money based on the current durability?
My Java Script is very limited but I guess I would have to this function first
$gameParty.totalDurability();
than the assign the value to a variable.
And make the costs for repair equal to the variable plus x amount.
But I have know idea how to right the code for that.
Would you be able to give me some pointers?
Thank you -
Basically, you need to do a few control variable calls for this:
Firstly, pick 2 variables.
For the first variable, set it to the MAX Durability of your items by choosing Script and adding $gameParty.totalDurability(true);
Then, take that same variable and subtract from it the value of the CURRENT Durability of your items by calling $gameParty.totalDurability():
This should leave you with either 0 if the two numbers matched, or a value equal to the missing durability.
From here, you can do conditionals to check if the number is 0 and if NOT, you can add any amount to the variable you want to set the blacksmith's price.
(I use a multiplier)
And the second variable was for your currency.
Since this is not a shop scene, you'll have to compare the gold yourself.
So at the beginning of your blacksmith event, it should set up similar to this:
Hope this helped. -
Hi @Maliki79Basically, you need to do a few control variable calls for this:
Firstly, pick 2 variables.
For the first variable, set it to the MAX Durability of your items by choosing Script and adding $gameParty.totalDurability(true);
View attachment 222296
Then, take that same variable and subtract from it the value of the CURRENT Durability of your items by calling $gameParty.totalDurability():
View attachment 222298
This should leave you with either 0 if the two numbers matched, or a value equal to the missing durability.
From here, you can do conditionals to check if the number is 0 and if NOT, you can add any amount to the variable you want to set the blacksmith's price.
(I use a multiplier)
And the second variable was for your currency.
Since this is not a shop scene, you'll have to compare the gold yourself.
So at the beginning of your blacksmith event, it should set up similar to this:
View attachment 222299
Hope this helped.
Wow you are a legend thx for this. Really appreciate it.
Actually as my coding is very limited I thought that there must be a way to do this with eventing and funny enough it looks like I was actually on the right way.
But this is definitely going to save me a lot of headache.
Thx mate -
Hey there, Maliki!
First, just wanted to say thanks for making this extension, it's very helpful!
Second, I wanted to ask - how exactly do we adjust max durability? I saw the 'object.durmax' reference, but wasn't sure where to put it. It obviously isn't a notetag (oh man, that'd make things easier on my personal ineptitude), but it looks like a script call, possibly?
EDIT: I should also add - I've already tried using it w/ a Yanfly 'Custom Repair Effect' notetag, and had no luck.
Please let me know once you get a chance; my end goal here is replicating the 'oil' items of the original Diablo expansion, Hellfire.
Oils, in detail(Leaving this in a spoiler, to avoid clutter)
Basically, certain oils would repair a percentage of the item's total durability if the durability was below maximum, or they'd add a +1 to the max durability if the item's durability was already at max.