Could you elaborate on what you mean by having no luck with the custom repair effect?
Maybe sharing exactly how you tried to do the effect would help.
Maliki's Item Durability EX ver 1.9
● ARCHIVED · READ-ONLY
-
-
Crap, I lost the exact formula I had in the note box when I was fiddling around with it... Pretty sure it was the following though, just switching out the first line's 'object':
<Custom Repair Effect>
if (object.totalDurability() == object.totalDurability(true)) {
object.totalDurability(true) = object.totalDurability(true) + 1;
} else {
$gameParty.fixAllDurability(20);
}
</Custom Repair Effect>
EDIT: I had this in an item note box, if that matters~ -
Try this:
JavaScript:<Custom Repair Effect> if (item.totalDurability() == item.totalDurability(true)) { item.durMax += 1; } else { item.durability += 20; } </Custom Repair Effect>
And yes, it being on an item is important.
This code NEEDS to be on the item being used to repair the equip item and it would need to happen thru the item action menu.
BTW - the fixAllDurability call will work, but if fixes dura for ALL items in your inventory. Not sure if that was what you wanted. -
Okay, I tried it and something very very weird happened; items disappeared from my inventory as well as chests during playtesting. I disabled your extension plugin, and all was back to normal.
What makes this extra strange - to me, anyways - is that I had your plugin enabled before, and test-played probably 100 times or more without a hitch. But once I put in this new notetag, it started acting up... Weird!
If there's any info or settings I can check to troubleshoot this phenomena, please let me know! Thanks again for your time! :)
EDIT: Also, unsure how this would/wouldn't be affected by DreamX's/Yanfly's independent item stuff?
EDIT AGAIN: Okay, so I tinkered around with it some more, and evidently I may have set the default durability to 0 and your plugin didn't like that, as I told it to make destroyed items unequippable; changed it back, and now I can use your plugin - so my apologies, that one was on me. However, the above notetag still does nothing, unfortunately - neither repairing durability nor adding to the maximum. One more piece of the puzzle - I set max durability per item with notetags. Could that be an issue here..? -
I see...
I did some more thorough testing and found the issue.
I think we can fix this via the notetags, but it'll have to wait til I can give a bit more time to the issue. Please be patient. -
Hey, it's all at your convenience. I'm absolutely in no rush, and am in fact simply elated that you'd even decide to have a go at it! :)
So thanks again - both for the time you've already spent mucking about with it, and for whatever additional time follows. I'll be waiting patiently. -
Thanks. I can offer this much now, my total durability function doesn't work the way I did it here.Hey, it's all at your convenience. I'm absolutely in no rush, and am in fact simply elated that you'd even decide to have a go at it! :)
So thanks again - both for the time you've already spent mucking about with it, and for whatever additional time follows. I'll be waiting patiently.
Try this for now:
JavaScript:<Custom Repair Effect> if (item.durabilty == item.durMax) { item.durMax += 1; item.durability += 1; } else { item.durability += 20; if (item.durabilty > item.durMax) item.durability = item.durMax; } </Custom Repair Effect>
If it still gives issues, I will likely have to edit the plugin to properly add the needed functions (which I may do anyway.) -
Wow, that was fast! Sadly though, it still isn't working completely. Basically it goes like this:
It seems as if the notetag above simply adds 20 to what the item's initial max durability was set at. I'm wracking my brain trying to thing if there is anything I set up that could be hindering things to work correctly, but I'm honestly drawing a blank - Yanfly's Durability and your extension plugin are all that I am using that would theoretically affect these values...- First, it adds +20 the item's durability; so a sword that was slightly damaged at 38/45 (current/max) becomes 58/45.
- On the next repair, it adds an additional +20 (I'm assuming), since it then becomes 65/45.
- Further applications have no effect.
I assumed that setting the <Durability Maximum: x> with each item may have been something, or possibly the independent item(s) facet... But I'm just guessing, because I'm way out of my depth, here. ~_~ -
A little progress is still progress. I'll check it out when I can.
-
Sounds good to me - thanks again for your help, it seriously means a lot. :)A little progress is still progress. I'll check it out when I can.
-
O--K!
I messed around with it a bit more this morning, and progress has been made! I changed the operator for the first bit of the formula ( = instead of == ), and it seems to work almost exactly as I'd hoped:
Code:<Custom Repair Effect> if (item.durabilty = item.durMax) { item.durMax += 1; item.durability += 1; } else { item.durability += 20; if (item.durabilty > item.durMax) item.durability = item.durMax; } </Custom Repair Effect>
It works as such:
- Using the same example item w/ 45/45 durability, it adds +1 to durability max to become 46/46! Huzzah!
- Next usage goes to 46/47 - so, we're still on track!
- The following 3 usages only increase max durability, ending up with the weapon being 46/50 durability, when it should just be repaired instead. >_<
Side NoteI should also add (and probably should've mentioned this at the beginning of this whole endeavor - I'll just blame my kids for eating my brain) that I'd like durability to become 'unbreakable' once it hits 255. It seems like this should be able to be worked into the above in some manner... -
The issue was a function from YF's original plugin that did not play well with mine.
It made it so the implied max durability could never go beyond the original setting.
I have fixed that and uploaded the updated plugin. Please DL that and you should be good to go.
As for your custom code, it was right for the most part before.
JavaScript:<Custom Repair Effect> if (item.durability == item.durMax) { item.durMax += 1; item.durability += 1; } else { item.durability += 20; if(item.durability > item.durMax) item.durability = item.durMax; } </Custom Repair Effect>
Now, while you are raising the max, please note that you should not lower it.
The way indestructible items are registered is by their durability max being -1, so be very careful with using code to change the max durability!
Let me know if you need anything else regarding this.
Good luck! -
It works exactly as it should - I can't thank you enough, Maliki. It's folks like you that keep this community running! :)
As for adding the unbreakable tag, I can just make a separate item to do that bit, or fiddle around with the code until I get it to work - so no worries there on your end, you've already went above and beyond as far as I'm concerned.
Thanks again for all of your help! -
@Maliki79 ... are you still watching this thread? If so, I would be curious if you had a guess as to why your script won't work in my game. It is placed directly under Yanfly's script, but in addition to YEP scripts, I also use Olivia (compass & eqiup set bonuses), Galv (diag movement), KageDesu (quests & inventory), Casper (crafting & encyclopedia), Khas (lighting), & SRD (HUD Maker).
I'm not getting any errors running your script... it's just that it doesn't work. Rather I try mode 2 or 3, or try to use your new note / script tags, nothing works... there's no effect... the armor still breaks & is destroyed in battle. Your script would be a VERY valuable asset in my game, as I don't like the "break effect" of Yanfly's default script... but I'm at a loss here for what to do. I'd like to avoid having to manually turn each of my plugins ON & OFF to see if I can find the culprit, as I believe I have 150+ of them & most (if not all) of them are being utilized in some part of the game, currently. -
First guess would be that you renamed the plugin when you saved it.
Please ensure it is named Mal_Durability_EX.js
Let me know if you are still having issues.
Thx -
You were correct. I didn't have it named correctly (it was "Mal Durability EX" b/c I had C/P'ed it from this thread & manually named it... I just forgot the underscores). However, that didn't fix the problem. I've tried moving it to various places on the plugin list too; from directly underneath Yanfly's to the very bottom. Placement, unfortunately, doesn't seem to matter... so it must be a plugin conflict. I just can't imagine which one.
-
When you renamed it, did you then go back and redo the plugin parameters? Also, consider trying from new game and not a save.
-
I deleted / removed the previous (mis-named) plugin prior to renaming it... but yes, I redid the parameters. As to the 'save game', I'm still in the development process of the game, so I'm play testing (each time from a new game). I have no saved games / files.
-
Ok. So it's likely a plugin conflict.
If that's the case, I probably won't be able to help further. -
Well... on a hunch, I just tried creating a new project with nothing but Yanfly's scripts (minimal needed) & yours, & I'm having the same problem. Maybe Yanfly changed something in the newest script updates that broke yours?