Custom Equip Types
By default, RPG Maker comes with 5 equip types:
- Weapon
- Shield
- Headgear
- Bodygear
- Accessory
You can rename them to suit your project needs, but if you wanted to have more than 5 types of equips and manage all of your weapons and armors using these additional equip types, you couldn’t.
This script allows you to create custom equip types with their own equip slot names. You can then assign custom equip types to different items, allowing you to create your own equip types. Combined with an equip slot script that allows you to add more slots to your actors, you can fully customize what your actors can wear and how they will be presented.
Download
Script: download here
You can assign these custom equip slots using Core – Equip Slots
If you would like to work with these custom equip types, the engine does not support them by default. You would need additional scripts:
- Equip Slot Fixing – allows you to fix your custom equip types
- Equip Slot Sealing – allows you to seal your custom equip types
Installation
Place this script below Materials and above Main
Usage
In the configuration section, set up the Equip_Types table with the custom equip types. Each equip type is given a unique number and a name.
To assign a custom equip type to an item, note-tag it with
<equip type: x>
Where x is one of the equip type ID’s that you have set up in the table.
FAQ
Q: My game crashes when I use more than 6 equip types
A: In Core – Equip Slots there is a configuration called “Sort Order”. You must specify all of the etype ID’s that will be used.
Q: I can’t equip the custom equips. I’ve note-tagged them correctly
A: Your actor needs to have the features that allows it to equip the weapon/armor type.
I am note tagging my item however it still deems it as . Any ideas or suggestions?
Here’s my set up.
Custom Types__________
module TH
module Custom_Equip_Types
# Set up your equip types here.
# Format: etypeID => name
Equip_Types = {
#-Default Equips Types----------------------------------------------------
0 => "Weapon",
1 => "Shield",
2 => "Headgear",
3 => "Bodygear",
4 => "Accessory",
#-Custom Equips Types-----------------------------------------------------
5 => "Pet",
6 => "Mount",
7 => "Wing"
}
Core_______________
module TH
module Core_Equip_Slots
# Order that the equip slots will be sorted. You must include all
# etype ID's defined in your project
Sort_Order = [0, 1, 2, 3, 4, 4, 4, 5, 6, 7]
# Default slots to assign to actor if no slots are provided.
Default_Slots = [0, 1, 2, 3, 4, 4, 4, 5, 6, 7]
# Assigns an equip slot
Regex = /<equip[-_ ]slot:\s*(\d+)\s*(?:(.*))\s*>/i
Actor_Notes______________
Armor_Notes_________________
Armor is set up as Accessory. With note-tag it should act as “Pet” but in game it still shows as an Accessory and only allows it to be placed in the slot 4 sections. I want it to go into the pet slot
Hello, Hime. I know you can start out equipping your character with a certain armor/weapon in custom slots using in the actor page of the database for equipping the second armor in your first equip slot. But, I want to give the player a choice at the beginning of the game, and that choice determines their initial equipment. Can I somehow turn this into a command in a conditional branch? For example, if they chose option 1, they get , but if they chose option 2, they get ? I know there is an event command to equip an actor with an item, but it only works for the default equipment slots. Thank you for your time, and for making this great script
For some reason, it doesn’t want to show what I put in less-than/greater-than brackets, I meant to say
[equip slot: 1 a2]
between “using – in the actor page” (with triangular brackets)
and
[equip slot: 1 a2]
and
[equip slot: 1 a4]
after “they get”
What I mean is, in Yanfly’s Ace Equip Engine, you can use the “Equip Actor with Armor X” command in the custom slots by assigning your armor to an default slot and it will automatically put for armor in your custom slot. For example, if you had a custom “Legs” slot, and an armor “Leather Leggings”, you could go to the armor page in the database, put the equip type as “Shield” (or any other default category), but put in the notes that “Leather Leggings” should actually be equipped in the “Legs” custom slot. Then, in an event, you can use the “Equip Actor with Armor X command”, and see the armor “Leather Leggings” listed under the “Shields” category. You can use this command to equip the Leather Leggings, and the script will override the “Shield” category and equip it to your custom slot “Legs”.
“Stack level too deep”
No idea what this means.
You have duplicate method calls in one or more script.
My issue is this: I’ve the note tags all set; even initializing equipment.
What happens: all custom equip slots, upon starting, place the equipment back in the inventory.
Here’s my character.
Evelynn…stats not important…
<equip slot: 0 w19>
<equip slot: 1 a41>
<equip slot: 2 a6>
<equip slot: 3 a1>
<equip slot: 4 a60>
<equip slot: 5 a52>
<equip slot: 6 a53>
<equip slot: 7 a57>
All the brackets are there, there’s no runtime error, just a52, a53, and a57 in my inventory, and cannot be re-equipped.
a52 is note-tagged like this:
<equip type: 4, 5,>
a53 is note-tagged like this:
<equip type: 4, 5, 6>
a57 is note-tagged like this:
<equip type: 4, 5,>
I have the scripts needed setup as they are supposed to be, I wonder what the issue is?
Nevermind.
Needed Multiple Equip Types; got it and this is now no longer an issue.
Oh ya, I separated the scripts since there may have been compatibility issues with other scripts.
Perhaps the instructions were not clear.
However, it must be like this:
<equip type: #>
<equip type: #>
<equip type: #>
This doesn’t work:
<equip type: #, #, #>
But with others, multiple tags per line do. I’m guessing that each script has to be programmed in this way. I’m such a novice.
No, the instructions were not clear.
Custom equip types do not support multiple equip types. If it did, the instructions would have mentioned it.
If you meant the “multiple equip types” script had confusing instructions, I looked at the usage and it mentioned that each equip type tag must be created separately.
I’m having issues using script calls to change equipment in that it doesn’t seem to work for anything except the basic equipment types in their standard order. If the equipment is listed in a different order or is not one of the basic types then it destroys the item instead.
Specifically I’m trying to get Falcao’s Tool selector working with either your system or Yanfly’s similar script and I can’t. But the fact that even change_equip script calls don’t work suggests that there’s something fundamentally broken with change_equip commands when using extra equip types. Is there something special that needs to happen in a script call to change equipment? If so I’m pretty sure I could make Falcao’s script work myself, but I’m totally lost on how to approach the problem.
Does this issue occur when you remove falcao’s tool selector?
Yes, that’s trying both $game_actors[id].change_equip_by_id(slot, equip) if $game_actors[id] and $game_actors[1].change_equip(n,$data_weapons[1]) syntaxes for changing equipment.
If the issue does not occur when Falcao’s tool selector has been removed, then you will need to try some more things
If #1 fails, then the script has bugs, but I have not had any issue with it on its own or with my other equip scripts.
If #2 fails, then the issue is another script in your project.
I should’ve spoken more clearly. The issue occurs even in a fresh project where only your two scripts exist.
$game_actors[id].change_equip_by_id(slot, equip) if $game_actors[id] works perfectly fine for Weapon and Bodygear when those slots are in those default positions, but nowhere else. For custom equip types it doesn’t work at all (and eats the item into the void for some reason).
I tried again with $game_actors[1].change_equip(n,$data_weapons[1])/$game_actors[1].change_equip(n,$data_armors[1])
and had the exact same results (I don’t think those two things are functionally different anyway?).
Then I tried with simple Change Equipment calls and still the same problems .
The script works perfectly fine for just manually equipping stuff through the menu screen, but I can’t get outside equipment requests to work. Should I send you my otherwise blank testing project where it’s not working properly?
That would be helpful.
Nevermind, I solved it. I thought I had tried this early on to no success but I guess I hadn’t. You have to specify the slot number based on where it is in the list, not what type it is. So if the custom item type “Tool” is slot type #6 but is #8 in your list, all script calls need to reference slot 8, not slot 6 (and of course subtract 1 from that cause the first slot is 0).
If that’s obviously stated somewhere I must be missing it cause I couldn’t find it said directly. I think it might be nice to add a line to the instructions for the script on on your site for the dense people like me who are still learning how RGSS3 actually works.
Anyway, thanks for your time and sorry for the alarm. Glad I got it worked out at least.
There may be a bug somewhere in my code.
In the custom equip type table, you have "Tool" set up as 8. This means that the equip type for tools is 8, and your tools would be note-tagged as follows in order to actually equip them:
<equip type: 8>
Assuming you have set up your actor with 6 equip slots, in the equip scene, the "Tool" equip slot will appear as the 6th slot on the list.
When you use
change_equip_by_id
, you specify the slot ID, which is the order that it appears in your equip list (minus 1, because Ruby). When you change equips, you should be changing equips by slot ID, not by equip type ID.If the tool slot is the 6th slot on your actor, I would expect
change_equip_by_id(5, ... )
To be the correct script call. If this is not the case send me the project and I will look at what's going on.
No I think it’s working fine.
The mistake is with this: “When you change equips, you should be changing equips by slot ID, not by equip type ID.” I never saw that spelled out anywhere, and thought it was the opposite. For some reason I thought I had tried doing it by slot ID, but apparently never tried it (otherwise would have solved the problem earlier). All the documentaiton for equip change I’ve seen anywhere says 0 for wepaon, 1 for shield, etc. – because those are the default slot IDs, but they also happen to be the dfault equip type IDs. Hence the confusion. As I said, unless I’m missing it somewhere, it might be nice to make that explicitly clear in your documentation of the script. Or maybe I’m the only one who’s made this mistake before?
Anyway, the issue is totally solved and I don’t think there’s an error with your code (at least when it comes to this).
I will add a note in the script.
Its possible to assign multiple types to one equip? something like: a dagger can be equipped at “hands” and at “accessory”, but not only at “hands”? (not at the same time) if not, you can make a update that can do it, like (Hands id) and (accessory id)??? thanks c:
Yes, there is a script called “Multiple Equip Types” that I apparently did not list under the add-ons. See if that works for you.
Another question:
Let’s say that I have a custom equip type called “Boots” and its etype ID is 6. Is there any way to check if a particular character has Boots equipped? ANY boots, no matter which ones. I know I can check for each individual item, but if I have – for example – 33 items that are Boots I would need 33 conditional branches per character. Is there any way I can do it with a single conditional branch that checks the etype ID instead?
item.etype_id
will return its etype ID. You will have to figure out how to get the item object. Utils: Equip Checks may be good for reference.Question: How do I “fix” a custom equip type? For example, let’s say equip type 6 is “Boots” and a character starts the game with a pair of cursed boots that he cannot remove until a quest is completed. How do I do that? The “Fix Equip” feature works for the default equip types, but what about the custom ones?
I’ve released a script for fixing custom equip types: http://himeworks.com/2014/11/equip-slot-fixing/
That’s perfect – thank you! goes to try it out
Hello,
I´m having a bit of an issue when using this script and Core – Equip Slots, not sure if it's a configuration mistake. I defined 4 new slots on Custom equip types, numbers 5 to 8. If I add this to the actor…
<equip slot: 6 a63>
<equip slot: 7 a1>
<equip slot: 8 a62>
…it works fine, the initial equips are equipped, and slot 5 is (correctly) missing from that actor. But if I add this:
<equip slot: 5>
<equip slot: 6 a63>
<equip slot: 7 a1>
<equip slot: 8 a62>
Then slot 5 is there, correctly without initial equip, but the initial equips on all other slots are in the inventory, but not equipped.
Thanks!
You're right, I actually did notice that behavior before…but never really thought that it was a bug.
And when I looked into it, turns out I wasn't even considering the possibility that there could be slots that were initially empty.
I've updated the script to address the bug.
It's working, thanks!
Is there a way to assign multiple slot types to one item?
for example: (equip type: 1,2,3)
I tried it, but it only takes the first number.
If there is no built in way, is that something easy to add?
Adding it is easy, but ensuring compatibility is not. I opened a discussion here https://github.com/Hime-Works/Requests/issues/28
There are existing scripts that already provide multiple equip types (one is presented there) and it seems to work fine.
Thanks, I'll try it out.
I don't think Multiple Equip Types works with your Equipment scripts. 🙁 I've tried it above and below and with and without your note tags, but it still won't show up in both categories.
Roguedeus might have made some modifications of his own to get it to work.
I wrote this a year ago but never released it. You can try and see if it works with your project. http://himeworks.com/redirect.php?type=script&name=multiple_equip_types
This works perfectly! Thank you very much! 😀
I'm having the same issues as Zavern. I've got both this and Core – Equip Slots in the script section, with custom equip types
5 = > "Gloves"
6 = > "Boots"
and Default_Slots = [0, 1, 2, 3, 4, 4, 5, 6],
with my gloves tagged with equip type: 5 (with the brackets which I can't type in here) but no gloves/boots appear in the equip section.
This doesn't work in a new project?
It's a pretty new project in general, it doesn't have any scripts that should have compatibility issues with your scripts so i'm not quite sure why it's having issues.
Your actor needs features to be able to equip them as well.
The slots are there for the actors, the issue is when you try and equip an item to those slots it's not showing any available items.
Ignore my last comment, i'm a moron, thanks for your help!
coughs Um. Hime? You're wearing casual clothes on your head.
Yes. It looks like it demonstrates that you can make it so that you can wear anything anywhere.
I can’t justify what happened there.
Can you help me out? I add <equip type: 6> to a pair of "Boots", but the boots won't appear in the equip selection.
Did you set the equip slot as type 6?