Jump to content

Recommended Posts

Custom Equipment Slots

Version 1.2

by Fomar0153

 

Introduction

Allows you to define custom equipment slots to characters, including the ability to add entirely new slot types.

 

Features

+ Can add multiple types of the same slot, e.g. 3 accessories.

+ Can have unique slots.

 

Screenshot

SS0017.png

 

How to Use

Instructions are in the script.

 

Script

The most update version of this script can always be found on my blog.

 

F.A.Q.

No questions asked.

 

Credits and Thanks

Fomar0153

 

Author's Notes

This is the update I had planned for a while. The script is now implemented in a much sleeker fashion and it much more compatible.

Edited by Fomar0153

Share this post


Link to post
Share on other sites

Okay... I had written a full great formatted answer pointing out all stuff and problems I occur and when I wanted to post it said I'm not logged in T_T

 

So here I go again a bit shorter q.q

I can't get this one to work :/ I don't know in your screen it works, so I'm not sure if its me who fails or if there are some bugs I encountered^^' But messing around with puts and trying to be logic it leads me to the 2nd conclusion.

 

On line 61/62 you check item.atype_id...i guess that's why the game will crash with the error that item doesn't have a method atype_id, when I try to equip a weapon. (if I make use of etype instead of atype it works well)

Also a soon as I want to select something in an additional slot (even if it's an already existing type like accesory) the game crashes on line 199 of Game_Actor since the object there seems to be nil.

I don't know much about the equip processing yet, so I can't tell you what's going on there exactly.

 

About the third problem encountered...I'm pretty sure it will be solved once the others two are. It's about optimizing the equipment. It crashes and I guess it's because of the other two problems.

 

I'd love to get this one running T_T so I'd be happy if you find a way to fix this problems :)

Oh, and I don't know, but maybe it's a nice feature for this script if it would be possible to assign some equip slots to some actors or classes only respective seal them.

Edited by DasMoony

Share this post


Link to post
Share on other sites

On line 61/62 you check item.atype_id...i guess that's why the game will crash with the error that item doesn't have atype_id when I try to equip a weapon. (if I make use of etype instead of atype it works well)

Also a soon as I want to select something in an additional slot (even if it's an already existing type like accesory) the game crashes on line 199 of Game_Actor since the object there seems to be nil.

I don't know much about the equip processing yet, so I can't tell you what's going on there exactly.

 

About the third problem encountered...I'm pretty sure it will be solved once the others two are. It's about optimizing the equipment. It crashes and I guess it's because of the other two problems.

 

I'd love to get this one running T_T so I'd be happy if you find a way to fix this problems :)

Oh, and I don't know, but maybe it's a nice feature for this script if it would be possible to assign some equip slots to some actors or classes only respective seal them.

Whoops, line 61 should have been if item.is_a?(RPG::Armor)

 

As for the second error what did you do to trigger it? How are you loading the script aswell?

As for optimisation I think the first error caused that so I think that fixed it.

 

I'll post a walk through of how to set this up so different characters have different equipment slots in due course. For now I'd like to try and fix that second error.

Share this post


Link to post
Share on other sites

So... I solved problem Number 2 and now is working everyhting fine. Your question aboutthe loading of the script gave me the solution.

 

It's kind of embarassing what the fault was :rolleyes: Currently I experiment most times only with several code snippets and until now I never had a problem when loading them as external files after the game started^^'

 

Yaay, I'm looking forward to the character-exclusive slots :)

Share this post


Link to post
Share on other sites

Ah good to hear I'll update the script in the first post in a minute.

 

Anyway here's the tutorial I promised.

 

Part 1: How to set up the script.

First you need to add an armour type for the new slot (in Terms in the database).

Note: Cannot be 1-4. Also note that Spell Tomes is Armor Type 7

Custom%20Equipment%20Tutorial%2001.png

Next when creating new pieces of this armour type make sure you select the correct armour type and make sure the characters have the trait allowing them to equip them.

Custom%20Equipment%20Tutorial%2002.png

Next you will need to fill in a little bit of code. The 7 refers to the same 7 in the armor type box in the first picture.

Custom%20Equipment%20Tutorial%2003.png

Finally you need to set up what slots are available to each character.

Custom%20Equipment%20Tutorial%2004.png

 

 

 

Part 2: Setting up for individual characters/classes

This section will require some scripting though not a great deal. Firstly an example of individual character equipment slots:


 def equip_slots
   case @actor_id
   when 1 # First character in the database
     return [0,0,2,3,4,4,4,7] if dual_wield?
     return [0,1,2,3,4,4,4,7]
   when 2 # First character in the database
     return [0,0,2,3,4,4,4] if dual_wield?
     return [0,1,2,3,4,4,4]
   end
 end

 

Or if you're using my Unique Classes script then you can do something like this:

class Game_BlueMage < Game_Actor
 def equip_slots
   return [0,0,2,3,4,8,8,8] if dual_wield?
   return [0,1,2,3,4,8,8,8]
 end
end

Which would just affect the blue mages in the party.

 

Hope that helps.

Share this post


Link to post
Share on other sites

Is there a way to make it where you get extra slots depending on the armor you have on? In Phantasy star online, armor had a random chance to have 0-4 slots, the slots let you equip addons that give minor stat boosts. (this isnt a request for randomly generated loot, this is a question about if the custom slots can somehow be controlled in this way)

Share this post


Link to post
Share on other sites

great script! small and really easy to customize!!! grats! :D

Thanks :)

Is there a way to make it where you get extra slots depending on the armor you have on? In Phantasy star online, armor had a random chance to have 0-4 slots, the slots let you equip addons that give minor stat boosts. (this isnt a request for randomly generated loot, this is a question about if the custom slots can somehow be controlled in this way)

Don't worry as Fomar0153 I know exactly what you mean. I shall look into it.

Share this post


Link to post
Share on other sites

I don't know if is my fault or script fault, but when I equip a L.Habilidad(Spell Tome), it dissapears!!!

Nothing is equipped and the item is gone T__T(Sorry for the spelling, but I'm Spanish)

Share this post


Link to post
Share on other sites

I don't know if is my fault or script fault, but when I equip a L.Habilidad(Spell Tome), it dissapears!!!

Nothing is equipped and the item is gone T__T(Sorry for the spelling, but I'm Spanish)

 

Odd could you post the script so I can just check you've set it up correctly and what other scripts do you have incase it is a compatibility issue?

Share this post


Link to post
Share on other sites

This is the script, the notes are translated because is more easy for me to read...

 

 

 

=begin

Custom Equipment Slots Script

by Fomar0153

Version 1.1

----------------------

Notas

----------------------

No requiere nada

Permite cambiar la pantalla de equipaje agregando más opciones

e.g. Agrega nuevas ranuras o pones más equipos predeterminados, como 3 accesorios

----------------------

Instrucciones

----------------------

Debes editar 2 secciones que están por la parte de arriba del script

estas son:

Slots[7] = "Spell Tomes"

return [0,0,2,3,4,4,4,7] if dual_wield?

Y sigue las instrucciones de sus respectivas partes.

----------------------

Change Log

----------------------

1.0 -> 1.1 : Se ha reparado un bug cuando equipabas una arma.

----------------------

Known bugs

----------------------

Nada

=end

#--------------------------------------------------------------------------

# â— New Module Extra_Slots

#--------------------------------------------------------------------------

module Extra_Slots

 

Slots = []

# Edita aqui para agregar nuevas ranuras.

# Slots[iD de Tipo de armadura] = "nombre"

# Se que está el nombre en la database, pero creo que no se puede llegar

# ha este nombre por los Vocablos

Slots[7] = "L.Habilidad"

 

end

 

class Game_Actor < Game_Battler

#--------------------------------------------------------------------------

# â— Rewrites equip_slots

#--------------------------------------------------------------------------

# Edita aqui para elegir las ranuras a tus aliados

# 0 - Arna

# 1 - Escudo

# 2 - Cabeza

# 3 - Cuerpo

# 4 - Accesorio

# 5+ Ranuras personalizadas

def equip_slots

return [0,0,7,2,3,4,4] if dual_wield?

return [0,1,7,2,3,4,4]

end

#--------------------------------------------------------------------------

# â— Rewrites change_equip

#--------------------------------------------------------------------------

def change_equip(slot_id, item)

return unless trade_item_with_party(item, equips[slot_id])

if item == nil

return if item && equip_slots[slot_id] != item.etype_id

else

if item.is_a?(RPG::Armor)

if Extra_Slots::Slots[item.atype_id] == nil

return if item && equip_slots[slot_id] != item.etype_id

else

return if item && equip_slots[slot_id] != item.atype_id

end

else

return if item && equip_slots[slot_id] != item.etype_id

end

end

@equips[slot_id].object = item

refresh

end

#--------------------------------------------------------------------------

# â— Rewrites release_unequippable_items

#--------------------------------------------------------------------------

def release_unequippable_items(item_gain = true)

@equips.each_with_index do |item, i|

if !equippable?(item.object) || item.object.etype_id != equip_slots

if item.is_armor?

unless Extra_Slots::Slots[equip_slots] == nil

unless item.object.atype_id == equip_slots

trade_item_with_party(nil, item.object) if item_gain

item.object = nil

end

else

trade_item_with_party(nil, item.object) if item_gain

item.object = nil

end

else

trade_item_with_party(nil, item.object) if item_gain

item.object = nil

end

end

end

end

end

 

class Window_EquipSlot < Window_Selectable

#--------------------------------------------------------------------------

# â— Rewrites slot_name

#--------------------------------------------------------------------------

def slot_name(index)

if @actor.equip_slots[index] >= 5

Extra_Slots::Slots[@actor.equip_slots[index]]

else

@actor ? Vocab::etype(@actor.equip_slots[index]) : ""

end

end

end

 

class Window_EquipItem < Window_ItemList

#--------------------------------------------------------------------------

# â— Rewrites include?

#--------------------------------------------------------------------------

def include?(item)

return true if item == nil

return false unless item.is_a?(RPG::EquipItem)

return false if @slot_id < 0

if item.is_a?(RPG::Armor)

if Extra_Slots::Slots[item.atype_id] == nil

return false if item.etype_id != @actor.equip_slots[@slot_id]

else

return false if item.atype_id != @actor.equip_slots[@slot_id]

end

else

return false if item.etype_id != @actor.equip_slots[@slot_id]

end

return @actor.equippable?(item)

end

end

 

class Scene_Equip < Scene_MenuBase

#--------------------------------------------------------------------------

# â— Aliases create_slot_window

#--------------------------------------------------------------------------

alias custom_slots_create_slot_window create_slot_window

def create_slot_window

custom_slots_create_slot_window

@slot_window.create_contents

@slot_window.refresh

end

#--------------------------------------------------------------------------

# â— Aliases on_actor_change

#--------------------------------------------------------------------------

alias custom_slots_on_actor_change on_actor_change

def on_actor_change

custom_slots_on_actor_change

@slot_window.create_contents

@slot_window.refresh

end

end

 

 

 

Well, I use YEA menu system without the equip scene because your equipskill system doesn't shows correctly.

Emm...Nothing that modify equip scene or scenes in general.

I think the error is a bad configuration.

Share this post


Link to post
Share on other sites

First of all I want to say thanks to script author, this is good script, it allows me to add what I want (despite the fact I need to change my ideas a bit), only thing I found bit annoying is, for example I want to give my character ability wear, lets say 8rings.

 

This means I need to make 8 new armor types, ring1 and ring2 and so on. This means I can’t just allow player wear all rings in combinations he/she wants, so the player could mix up what ever he/she wants. And that is kind a limiting players freedom from ability to choose what he/she wants, to few combinations that is given already by me.

 

Also when editing items at database I have to set which ring will be at 1st or 2nd armor type. And that’s kind a frustrating, cause I don’t want to set all rings in different types, better would be if all 8 rings could stay under 1 armor type.

 

So I'm just saying, (I don’t know if isn’t already such script allowing player wear many same type items in combinations he/she wants) isn’t there a way how to make this script works different? I would really like to see player’s excitement when character is wearing massive amount of the same type armors, cause this way he could discover new things/make super strong character and so on.

Share this post


Link to post
Share on other sites

First of all I want to say thanks to script author, this is good script, it allows me to add what I want (despite the fact I need to change my ideas a bit), only thing I found bit annoying is, for example I want to give my character ability wear, lets say 8rings.

 

This means I need to make 8 new armor types, ring1 and ring2 and so on. This means I can’t just allow player wear all rings in combinations he/she wants, so the player could mix up what ever he/she wants. And that is kind a limiting players freedom from ability to choose what he/she wants, to few combinations that is given already by me.

 

Also when editing items at database I have to set which ring will be at 1st or 2nd armor type. And that’s kind a frustrating, cause I don’t want to set all rings in different types, better would be if all 8 rings could stay under 1 armor type.

 

So I'm just saying, (I don’t know if isn’t already such script allowing player wear many same type items in combinations he/she wants) isn’t there a way how to make this script works different? I would really like to see player’s excitement when character is wearing massive amount of the same type armors, cause this way he could discover new things/make super strong character and so on.

 

Just set the rings as the same type? e.g.


module Extra_Slots

 Slots = []
 # Edit here to add new slot types
 # Slots[armour_type_id] = "name"
 # I know it is named in the database but I don't believe you can access
 # that name through Vocab
 Slots[7] = "Rings"

end

class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # â— Rewrites equip_slots
 #--------------------------------------------------------------------------
 # Edit here to change what slots are available to your characters
 # 0 - Weapon
 # 1 - Shield
 # 2 - Head
 # 3 - Body
 # 4 - Accessory
 # 5+ a custom slot
 def equip_slots
   return [0,0,2,3,4,7,7,7,7,7,7,7,7,7] if dual_wield?
   return [0,1,2,3,4,7,7,7,7,7,7,7,7,7]
 end

Share this post


Link to post
Share on other sites

Is there a way to make it where you get extra slots depending on the armor you have on? In Phantasy star online, armor had a random chance to have 0-4 slots, the slots let you equip addons that give minor stat boosts. (this isnt a request for randomly generated loot, this is a question about if the custom slots can somehow be controlled in this way)

Haven't forgotten, I keep toying with the idea of making this script use note tagging as it would make the script much nicer and increase compatibility. But it would mean having to rewrite the slots add-on. It'll happen at some point.

Is there a way for this script to allow 2 handed weapons?

This script doesn't alter the method of creating two handed weapons. As far as I'm aware they should work as they always do.

Edited by Fomar0153

Share this post


Link to post
Share on other sites

Well, a Example:

 

You Equpped a +2 Defense Shoe

and if you try to replace that Item with a +1 Defense Shoe

it will say in the Description, that that item is +1 Defense

better that the another one.

It's okay, it's just a Visual Bug, i think.

 

Also: Equip Best won't work with these Slots

and Remove All Equips (Unequip all) caused to delete the Extra Slot Items, the Actor was wearing.

Share this post


Link to post
Share on other sites

Well, a Example:

 

You Equpped a +2 Defense Shoe

and if you try to replace that Item with a +1 Defense Shoe

it will say in the Description, that that item is +1 Defense

better that the another one.

It's okay, it's just a Visual Bug, i think.

I don't understand.

Also: Equip Best won't work with these Slots

and Remove All Equips (Unequip all) caused to delete the Extra Slot Items, the Actor was wearing.

I'll fix these when I do the next version of the script.

Share this post


Link to post
Share on other sites

I have noticed that with this script when you create several more armour types, like boots, gloves, belts and cloaks... that type of thing.

It does not show in the status screen within the main menu. Is there a script add-on that will show the armour types (and the equipped armour) created by this script in the status screen within the main menu?

If not, then may I get instructions on how to modify the status section of the main menu to show the extra armour types that is created by this script?

Edited by Shadow Fox

Share this post


Link to post
Share on other sites

Updated to version 1.2.

It should be much more compatible for example you should no longer require the compatibility patch when using either version of my equipment skills script.

Also Optimise and Remove All should now work properly.

The status screen will now show all equipment but if you use too many slots then it will begin clashing with the character description.

 

Current plans: I might need to update my two equipment skills scripts, I've had a bug report that I need to investigate. After which I will begin looking into equipment adding more equipment slots.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×