This script provides several utility functions for changing equips. If you are using scripts that provide custom equip types, you won’t be able to use the default change weapon/change armor.
Additional functions can be added as needed.
Script: download here
In the script editor, place this script below Party Manager and above Main
There are two ways to equip something
- Specifying a particular slot ID, or
- Specifying a particular etype ID
Important: these script calls behave the same way as the regular “change equipment” event command: you must have the equip in your inventory for it to be equipped. This is because wearing a piece of armor is not the same as adding a piece of armor to your inventory and putting it on.
Equip by Slot ID
Slot ID’s are numbered based on the order that they appear for a given actor. The first slot in your list is slot 1, the second slot is 2, and so on.
When you specify a slot ID, the engine will simply try to equip it in that slot. If it doesn’t work, then it will automatically be removed.
The script calls for this are
equip_weapon(actor_id, slot_id, weapon_id) equip_armor(actor_id, slot_id, armor_id) equip_item(actor_id, slot_id, item_id) remove_equip(actor_id, slot_id)
Equip by Etype ID
When you specify an etype ID, the engine will try to find a slot that has the appropriate etype ID. If it finds one, it will equip the item in that slot. If it doesn’t, then it will not do anything.
The script calls for this are
equip_weapon_by_etype(actor_id, etype_id, weapon_id) equip_armor_by_etype(actor_id, etype_id, armor_id)
I'm using this script together with Core- Equip Slots and Custom Slots. Since I have two accessory slots (same etype), it seems right now the function equip_armor_by_etype locates the first compatible slot, regardless if there is already an accessory equipped there, and equips the item there (the previosly equipped item goes to the inventory). So I was wondering if it would be possible to change the function, to test if there is an avaliable and empty slot of a certain etype, since with those scripts we can have more than one.
I'm trying to use an item, to equip multiple armor/weapons at once.
it works with standard equipment.
but I'd like to have it work with etypes. the problem I have is how to get 'actor.id' to refrence the chosen actor instead of using an id.
so my 'set' works as a potion would. that calls a common event, 'equip armor' on the selected one.
if that makes sense.
If you need to work with etypes there are
available. Otherwise you should explain why you need a reference to the actor.
I have the Kitsune Set, common evented to equip with the full armor.
but I can only select the actor in the 'change equipment' event.
I'd like to use your script to reference the actor chosen in the item window.
would it help if i made a demo project to try and show what I need?
I would use common event variables, since you're using a common event for this http://himeworks.com/common-event-variables
which gives me this error
I'm only trying with 1 equip till I figure it out.
Those are codes for messages only. Script call requires proper variables: $game_variables
Also very greatly appreciate how quickly to get back with help.
Added methods for automatically finding slot ID's given an etype ID.