Adding Durability to Equipment in RPG Maker MV with Yanfly
I try not to use scripts when it comes to RPG Maker. I’ve found over the years that scripts are a very deep rabbit hole and can quickly lead to ever expanding project feature creep. However, sometimes there are systems or functionalities that simply cannot be worked around with events. Equipment durability is one of these.
Table of Contents
- Requirements
- Installation & Activation
- Adding Equipment Durability
Requirements
Before we can begin, you will need to have the following scripts:
Alternatively, Yanfly has a complete pack for $30 that includes all scripts instead of the $10 for Item & Equip Scripts. Find that here
Once you have access to these, download them and in the next section we will set them up. If you’ve already done so, feel free to skip to the final section.
Installing & Activation
Once you have downloaded Yanfly’s Item Core & Item Durability scripts, we need to bring them into RPG Maker MV for use.
At the top of your game’s toolbar, we can find a quick shortcut to open our project folder:
After we have our project folder open, navigate to the /js/plugins folder, which is where we will drop our Yanfly scripts
Now we can close these folders out and go back to our game. Open the plugin manager (seen below)
To add in our script Yanfly’s Item Core, double-click in the first available open space. You will be greeted with the Plugin dialog box:
To add in the script, simply open the Name dropdown box and select “Yep_ItemCore”. The plugin will auto-fill.
Verify that the Plugin Status is “ON” and click OK to activate!
Repeat this process for the Item Durability script.
Now that we have added in and activated our scripts, in the next section we will add item durability to our character’s weapon.
Adding Equipment Durability
Per the script documentation, adding durability is as simple as using a Notetag. Notetags are little instructions written in the Notes section of the database. These tags will only be used if a script is specifically written to read Notetags. This is why we added in the ItemCore before the ItemDurability.
The Item Durability notetag is: <Durability: x> where X is equal to the amount of durability a piece of equipment has.
For the purpose of this tutorial, I want to create a weak sword that will break on its next use. In order to do this, all we need to do is add the notetag in the notes section of a new item:
Test it in game and…
The sword breaks as expected!
Note that there are a lot of additional things that can be done now with equipment and if you have additional questions regarding the newly installed ItemCore and ItemDurability scripts, check out Yanfly’s extensive documentation on their website Yanfly.moe, or reach out to me here.
Good luck and happy game making!