RSS

[Tutorial] 姫Hime’s Core – Equip Slots

29 Sep

Ever felt like the default equipment slots are too limited? Ever felt like you want to gear up your character to the teeth? Maybe your main character is a three-armed mutant and you want to equip him/her with 3 weapons? Or you are wanted to be able to equip a weapon on each and every equipment slot possible? Well, this script is the answer to your prayers.

Table of Contents

  • What is Hime’s Core – Equip Slots script?
  • How to install Hime’s Core – Equip Slots script?
  • How to use Hime’s Core – Equip Slots in your own game?
  • Add-ons to Hime’s Core – Equip Slots
    • Custom Equip Types – set up custom slot types
    • Multiple Equip Types – allows you to place an equip in multiple slots
    • Equip Slot Sealing – allows you to seal custom equip slots
    • Equip Slot Fixing – allows you to fix custom equip slots
    • Utils: Change Equip – script calls to change equips, if the event editor can’t help
    • Dynamic Equip Slots – add or remove equip slots during the game

Notes:

  • Any of the icons used in this tutorial belongs to Blizzard Entertainment. You may not ask me for permission to use them in your game and I never claim ownership over them.
  • Hime’s scripts are free to use in non-commercial projects. Please contact Hime if you wish to use these scripts in a commercial projects. The Terms of Use can be found here, and you can contact Hime directly by clicking here.
  • Other images are the property of Enterbrain.


What is Hime’s Core – Equip Slots script?

This script allows us to customize our actors’ equipment slots. We can choose exactly which slots we want to have available for each actor/class. We can also choose how many (or how few) of each slots we want to have for each class/actor. With a simple reordering of a few numbers in the script, you can easily change the order of how the equipment show up in your equipment window.

Each actor comes with 5 equipment slots in RPGmaker; weapon, shield, head, body, and accessory. You are limited to one equipment in each slot and you cannot add additional equipment slot. The seal equip feature allows us to disable some equipment slots, but they will still be visible in-game. This can be frustrating for fussy individuals such as me.

Some people might prefer Yanfly’s Equipment script, but it feels like Hime’s Core Equip Slots script (along with all the add-ons) is easier to use.


How to install Hime’s Core – Equip Slots script?

Get the script from Hime’s website, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. It is the same as any other script. Remember to give the script the appropriate name so that you can find it easily when installing add-on to this script later. Even though most of the add-on does not require you to do so, it is a good idea to place the add-on scripts below the Core script, some add-on will require you to do this so pay attention to the requirement of each add-on.


How to use Hime’s Core – Equip Slots in your own game?

Before we start, I would like to mention that this is just the core scripts, therefore the functionality is limited. This script can allow you to have multiple equipment for each slot, changing the order of which equipment slot show up first and hide the ones we want to seal. You are bound to the equipment slot rule; you cannot equip something into an equipment slot that they do not belong to. Refer to the add-ons if you are looking for more advanced functions.

By default, there are five equip slots: weapons, shields, headgear, bodygear, and accessory. And thus, each of these slot comes with their own type ID. What this means is that the first equipment slot (slot ID = 0) will only accept equipment of type 0, the second equipment slot (slot ID = 1) will only accept equipment of type 1, and so on. Here’s the default equipment type ID and the default equipment slot ID:

  • 0 – weapon
  • 1 – shield
  • 2 – headgear
  • 3 – bodygear
  • 4 – accessory

These are built-in and you cannot change it with the Core Equip Slots script. You will need to look at Hime’s Custom Equip Types add-on to change any of that.

Go to Script Editor (Click Tools > Script Editor or press F11), find the script and go to line 90. The section underneath Configuration is the only section that you need to worry about.

Sort_Order determines the order in which the equipment slot shows up in-game. We can re-arrange the numbers in whatever order we want them to show up in the game.

Here we can change the order the weapon/armor show up in our equipment. Maybe we want to show the character’s armor before the character’s weapon. We can easily do that by re-arranging the numbers located within the the square brackets for Sort_Order. Remember to include all the slots available! We cannot leave out any of the available slot or we will run into error.

Default sort order for all the equipment. Sort_Order = [ 0, 1, 2, 3, 4 ] means that your equipment slots will show up in the following order: Weapon, Shield, Headgear, Bodygear, Accessory.

Now that we have changed the Sort_Order to 1, 4, 3, 2, 0, the equipment slots will show up in the following order: Shield, Accessory, Bodygear, Headgear, Weapon.

Now that we got the script and the slot order sorted, we will move on to tagging the actors, classes, weapons and armors. First, we will need to go to our game’s database to insert the note tags. If you are unsure what/where to insert the note tags, open the Database window (click on Tools > Database, or press F9), and refer to the image below

There are note tag box under actors, class, weapon, and armor tab. Those are the 4 tabs we will use for this script.

The note tag for the Actors and the Class tab is <equip slot: x>, where x is the equip type number for the equipment that fits that slot. Note tags added to the class tab will serve as the default equipment slot for that particular class. You can overwrite this and create a unique character by individually tagging each actors in the actor tab.

If the Paladin class has the following note tags:
<equip slot: 0>
<equip slot: 1>
<equip slot: 4>

This means that the Paladin class can only equip a weapon, a shield and an accessory. If we want to open up other equipment slot for a particular actor we do so by adding more tags.

By tagging the actor with these tags:
<equip slot: 0>
<equip slot: 0>
<equip slot: 0>
<equip slot: 2>
<equip slot: 2>
<equip slot: 4>

This means that the actor will have 3 weapon slots, 2 helmet slots and 1 accessory slot no matter what class the character changed to. I would personally avoid tagging actor individually, unless I am absolutely sure that’s the way that character functions.

We can also expand on the Actor tag further to include the actor’s starting equipment using <equip slot: x w1> or <equip slot: x a1>. We use ‘w’ for weapon and ‘a’ for armor. <equip slot: x w1> simply means that we will try insert weapon, whose ID = 1, into equipment slot x. <equip slot: x a1> means that we will try to insert armor, whose ID = 1, into equipment slot x. The number we use depends on which weapon/armor that we want to try to insert to equipment slot x.

I set it so that Eric starts off with weapon 1 in the first slot (slot ID = 0), in the second slot (slot ID = 1), and in his third slot (slot ID = 2). This also means that Eric will only have these equipment slot available regardless of what class he change into.

Since we cannot equip some weapon in shield slot and in headgear slot, they ended up in my inventory, which is why I only have 1 Corrupted Ashbringer equipped and the other 2 ended up in my inventory.


Add-ons to Hime’s Core – Equip Slots

  • Custom Equip Types – set up custom slot types
  • Multiple Equip Types – allows you to place an equip in multiple slots
  • Equip Slot Sealing – allows you to seal custom equip slots
  • Equip Slot Fixing – allows you to fix custom equip slots
  • Utils: Change Equip – script calls to change equips, if the event editor can’t help
  • Dynamic Equip Slots – add or remove equip slots during the game

Custom Equip Types Add-on

Requirement(s): None.

Maybe you are not satisfied with the limited default equipment slot. Maybe you want to include other slots such as cape, boots, gloves, belt, shoulder guard, etc.Or maybe you are not satisfied with how RPGmaker name the equipment slots.This add-on to Hime’s Core Equip Slots script is your solution.

This script allows you to create custom equipment types and equipment slots with their own names. Combined with the Core Equip Slot script to create more slots for your actors and class, you can fully customize what each actor/class can wear and how they are presented in-game.

How to use this Add-on?

Step 1: To start off, get the script from here, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. I recommend putting this underneath Hime’s Core Equip Slot script just for the sake of good organization.

Step 2: Look under the configuration section as shown in the image above. As you can see, we have the default equip slot 0 – 4, and the rest are all the custom equip slots added. The number represents equip slot ID, and the name represents the equipment slot name. I renamed “Accessory” to “Trinket”, which is why there is no “Accessory” slot. The accessory slot will show up as “Trinket” slot instead of “Accessory” in game.

Step 3: Go back to Hime’s Core Equip Slot script and add in the ID number for all the custom equipment you added in Sort_Order. If I have 14 different equip slot, make sure that Sort_Order = […] contains all 14 equip slot ID number for all the slots. Missing even 1 of them will result in an error.

If you get this error, it is most likely because you left out an equipment slot ID from Step 3. I named the core script “Hime Core Equip Slot”, if you name the core script as something else, you will see a different name within the red box.

Step 4: Insert the relevant tags into the note area for your class tab or actor tab. Also remember to include the ability to use it in the “feature” box. In the image above, the Paladin class will have equip slot 0 – 11 available to them.

To change the amount of equipment slot for each equipment type, all we have to do is to have multiple lines of <equip slot: x> in the class or in the actor tab:

As you can see, we have 7 lines of <equip slot: 4> in the note section, this means that the Paladin class can only equip 7 of the equipment of equip type 4. In this example, equipment of type 4 is “Trinket”.

Once we are in-game, we can see that the Paladin class player can only equip 7 trinkets.

Similar to the Core Equip Slot script, we can freely change the way the equipment slot are presented in-game by changing the ordering of the number that appears in Sort_Order.

Another thing we can do with the Custom Equip Type script is to use note tag to overwrite the equipment type that we set for each piece of equipment. The square around “Equip Type” clearly indicates that the Judgement Breastplate can only fit into Body slot, however the note tag says that the breastplate can only fit in slot 2 (helmet).

As you can see, the Judgement Breastplate appeared under the headgear slot because we use the item note tag to make it so that it will only fit into headgear slot. This way, we can equip whatever we want in whatever slot we desire.

As you can see, I am able to equip weapon in my headgear and bodygear slot because the weapon note tag allows me to do so. If your headgear slot is 2, and you use the note tag on your weapon, then you can equip that weapon on your headgear slot.

One thing to remember is that you cannot make 2 handed weapon by including multiple note tag as shown in the image above. You will have to use the “Seal Equip” method under “Features”. If you include multiple note tag (like the one shown in the image above), only the first one will be evaluated. The second note tag will be ignored.

That’s about it for the Custom Equip Type script.


Multiple Equip Types Add-on

Requirement(s): Hime’s Core Equip Slot script, Hime’s Multiple Equip Types script

Ever came across a situation where you want to create a weapon that can go in either the weapon or the shield slot? There are ways to do so using only the Custom Equip Types Add-on above, but it can get really messy. Okay, let’s be serious. It is impossible without this add-on.

How to use this add-on?

Step 1: To start off, get the script from here, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. Make sure that this script comes after Hime’s Core Equip Slot script and Hime’s Multiple Equip Slot script.

Step 2: Tagging the weapon you want with the appropriate tag that allows player to equip it on either the weapon or the shield slot.

As we can see above, the script is not limited to making weapon that fit on either hand (without having to create duplicate of the same weapon in the database in order to create the illusion that you can equip a weapon on either hand). We can do the same with shield, armor, and accessory provided that we tag each of them correctly.


Equip Slot Sealing Add-on

Requirement(s): none

Can be used for: Actor, Class, Weapon, Armor, States

By default, we can seal equipment slot using the Seal Equip feature, but this is only limited to the default equipment types (weapon, shield, headgear, bodygear, and accessory). We will need another solution if we want to seal our custom equipment slot. This script will let you achieve just that.

How to use this add-on?

Step 1: To start off, get the script from here, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. There are no requirement about whether you should put this script in the script editor.

Step 2: Give the weapon with the proper tag to seal the appropriate slot, where x is the slot ID number for the slot(s) that you want to seal by equipping this weapon.

Just a before and after comparison of what happens when you put on that sword in-game. Greyed out equip slot name means those equip slots are sealed.

Example: a state that will seal player’s equipment slot that will only be removed after the player moved 100 steps.


Equip Slot Fixing Add-on

Requirement(s): none

Can be used for: Actor, Class, Weapon, Armor, States

By default, we can also fix equipment slot by using the Fix Equip feature, but that is only limited to the default equipment slots (weapon, shield, headgear, bodygear, and accessory). If we have custom equipment slots, we will need this script to fix them. Once a gear slot is fixed, the player will not be able to change the equipment in that slot manually till the fix is gone. Since equipment slots are permanently fixed if you used the <fix etype: x> note tag for your actor/class, you might ask “How can I change equipment if they are fixed?”, I will get to that after this.

How to use this add-on?

Step 1: To start off, get the script from here, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. There are no requirement about whether you should put this script in the script editor.

Step 2: Give the weapon/armor/state/actor/class the appropriate tag. Once in-game, all these equip slot(s) will be fixed and the player will not be able to change whatever equipment is on it manually.

Example: A sword that will fix the other equipment slot for as long as it is equipped. The player will not be able to change whatever they have equipped in those greyed out slots for as long as the weapon with tag is equipped.

Example: A state that will prevent player from manually changing equipment from the equip slots stated in the note tag. The state will be removed after the player walked 100 steps in-game.


Utils: Change Equips Add-on

Requirement(s): none

By default, we can seal equipment slot using the Seal Equip feature, but this is only limited to the default equipment types (weapon, shield, headgear, bodygear, and accessory). We will need another solution if we want to seal our custom equipment slot. This script will let you achieve just that.

How to use this add-on?

To start off, get the script from here, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. There are no requirement about whether you should put the script in the script editor.

Remember how we have the ability to fix equipment slot using Hime’s Equip Slot Fixing script, so that the players cannot change their equipment manually? You can use this Change Equip script and change the equipment is fixed slot through script call. There are two different groups of script call that we can use:

  1. Specifying a particular slot ID
  2. Specifying a particular etype ID

This can be a little confusing, so please pay attention. There is a subtle difference between the ID number used for the two methods!!!


Changing equipment by specifying a particular slot ID

Changing equipment by specifying a particular slot ID can be done through the following script calls:

equip_weapon(actor_id, slot_id, weapon_id)
equip_armor(actor_id, slot_id, armor_id)
remove_equip(actor_id, slot_id)

Actor ID, actor_id, is the ID number of the actor involved. By default, the player is using the actor with the ID number 1.
Slot ID, slot_id, is based on how you order your equipment slot using the previous script, Hime’s Core Equip Type script.
Item ID, weapon_id or armor_id, is the ID number of the equipment you want to equip. Refer to the image below.

As you can see, it does not matter what number you assign to each slot using Hime’s Multiple Equip Types script, we are using the order they appear in-game to equip each slot. In this example, weapon = 1, shield = 2, headgear = 3, bodygear = 4, and legs = 5.

In this example, equip_weapon(1, 1, 1) means that we will equip actor 1 with weapon ID 1 in equip slot 1. We will let Eric equip the Corrupted Ashbringer in his weapon slot. The next line, equip_armor(1, 2, 11) means that we will equip actor 1 with armor ID 11 in equip slot 2. Using the same example, we are equipping Eric with the Bulwark of Azzinoth in his equip slot 2, the shield slot. Refer to the next image if you need some visuals.

As you can see, the equipment slot names are greyed out, which means that we cannot change equipment manually. Equipping those 2 items are done through the script call in the previous image.


Changing equipment by specifying etype ID

Changing equipment by specifying a particular etype ID can be done through the following script calls:

equip_weapon_by_etype(actor_id, etype_id, weapon_id)
equip_armor_by_etype(actor_id, etype_id, armor_id)

Actor ID, actor_id, is the ID number of the actor involved. By default, the player is using the actor with the ID number 1.
Equipment type ID, etype_id, is based on the value assigned to each slot using Hime’s Custom Equip Type script. Refer to the image below.
Item ID, weapon_id or armor_id, is the ID number of the equipment you want to equip.

Based off this example: weapon’s etype_id = 0, shield’s etype_id = 1, headgear’s etype_id = 2, bodygear’s etype_id = 3, trinket’s etype_id =4, and so on…

In this example, Option 1: equip_weapon_by_etype(1, 0, 1) means that we will equip actor 1, Eric, with weapon 1, the Corrupted Ashbringer, in his weapon slot, 0. The next line, equip_armor_by_etype(1, 1, 11) means that we will equip actor 1, Eric, with armor 11, the Bulwark of Azzinoth, in his shield slot, 1.

This is what is going to happen if player select Option 1 in-game.

This is the result for selecting option 2. I have all the weapon in my inventory but nothing is equipped in my weapon slot because weapon ID 3 is a 2 handed weapon. It also means that if we equip a shield, then the weapon will automatically get unequipped. This is also because I called equip_weapon_by_etype(1, 0, 3) before calling equip_armor_by_etype(1, 1, 15). The script will equip the 2-handed weapon with ID number 3, AND THEN equip the shield with ID number 15. Since we cannot equip both 2-handed weapon and a shield, the 2-handed weapon is removed, leaving you with only a shield equipped.

If the weapon/armor you specified in your script call does not exist, then nothing will happen.


Dynamic Equipment Slot Add-on

Requirement(s): Hime’s Core Equip Slot script

With this add-on, you can increase or decrease the number of equipment slot that your actor has through a script call:

  • add_equip_slot(actor_id, etype_id)
  • remove_equip_slot(actor_id, etype_id)

It is relatively easy to use, however you have to be careful about using this with the Change Equip add-on’s method of changing equipment by particular ID. Remember these methods in the previous add-on?

equip_weapon(actor_id, slot_id, weapon_id)
equip_armor(actor_id, slot_id, armor_id)
remove_equip(actor_id, slot_id)

The slot_id is determined by how the order of equipment that show up, since this, dynamic equipment slot add-on, adds and re-arranges your equipment slots, it will interfere with the slot ordering. I will provide an example for this shortly.

How to use this add-on?

To start off, get the script from here, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. Make sure this script is below Hime’s Core Script in the script editor.

Then all you need to do is to set up the NPC event page and use the script call to add/remove equipment slot(s).

This is what I have for my default equipment slot.

I have this code for the NPC event page. I want to add 5 additional shield slot for actor 1. Once this is made, all I need to do is to talk with the NPC in order to gain 5 additional shield slot for actor 1.

This is what happens after I talked to the NPC. Additional shield slots are added, and the equipment slots are re-organized so that the additional shield slot appear next to the existing shield slot (instead of appearing at the bottom of the equipment list). Now I hope you can see how the previous script, Util: Change Equipment by type, can run into problem. To use that script with this, you have to use the equip_by_weapon/armor_etype(…) method instead.

This is the event page of another NPC whose role is to remove the equipment slot 1 from our actor. In this example, equipment slot 1 is the shield slot.

As you can see, after talking to the NPC, all the shield slots are removed. The script remove_equip_slot(…) will remove the slot you specify till there is no such equipment slot left. All the equipment you put on that slot will be returned to your inventory.

 
Leave a comment

Posted by on September 29, 2015 in Scripts

 

Tags:

Leave a comment