• Announcements

    • RagingHobo

      Forum Upgraded!   07/17/2017

      We have successfully upgraded our forum to the latest version! Some things have moved around but don't worry everything is still there, we still need to find updated versions of the plugins we were using previously to restore everything to the way it was. There will be a running topic in the Feedback and Support in case you notice something wrong. Before you do so please clear your browser cache and close your browser completely to rule out a caching issue. Thank you for your patience during the outage and while we get everything back to 150%  
Tsukihime

FP Equip slots

53 posts in this topic

This script is no longer supported.

If you wish to have custom equip slots and be able to add or remove them during the game, consider using Dynamic Equip Slots: http://www.rpgmakervxace.net/topic/16670-dynamic-equip-slots/ along with TH Core: Equip Slots http://himeworks.wordpress.com/2013/07/13/core-equip-slots/

 

FP: Equip Slots

Author: Tsukihime

Type: Features add-on

 

Overview

 

Who says you can't wear 5 hats or 3 coats?

 

This script provides basic functionality to expand the number of equip slots for every equip type.

It also allows you to dynamically change your actor's equip slots in-game.

 

Features

  • Change the number of equip slots you can have
  • Create custom equip types
  • Specify custom sort order for equip types (order which they appear)
  • Allow equips to add more equip slots
  • Allow classes to add more equip slots
Usage

 

important: this script does not provide any "default" equip slots. You must manually give all of your actors some equip slots to work with

 

In the configuration, just specify how many equip slots you want for each type of slot.

You can add additional equip types by adding more entries in the "extended equip types" section.

 

To specify that an equip is of that type, use the following notetag

<etype n>
Where n corresponds to the equip type defined in the table above.

 

If you would like a custom sort order (eg: gloves appear above weapon), you can modify Equip_Order to something you like. Note that there is no way to interweave equip types (eg: weapon, shield, weapon, bodygear, weapon).

 

In order to add slots to your actors, you must use "features". This is not available

in the default editor, so you will need to use notetags.

 

In actors, classes, weapons, armors, and states, you can type

<+eslot: slot_type amount>

<+eslot: 0 3>
<+eslot: 1 1>
The first example says to add two slot 0's. Slot 0 by default is the weapon slot, so your actor will have two weapon slots.

 

Because these are features, the slots change depending on what you equip, what your class is, and who the actor is. It is also possible to change slots in game using script calls.

 

You can add more slots to your actor directly through script calls.

add_slot(actor_id, slot_type, amount)
This will add the given amount of slots based on the specified slot type to that actor.

 

Screenshots

 

Lots of slots

hhPkM.jpg

 

Equipping a shield gave me more slots

Wu0al.jpg

 

Downloads

 

Script: http://db.tt/NnnLMyGb

 

Kread-Ex's Actor inventory

 

Notes

 

If anyone needs to access the feature, the code is 103.

 

Here is an example on how to set up a bow and arrow equip set: http://www.rpgmakervxace.net/topic/5089-dual-wield-is-causing-me-some-problems/#entry43950

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Script revised.

Now you can easily add additional equip types in the database

 

0RnT2.jpg

 

Just tag it with

 

<fp:es etype 6>

 

Where the number corresponds to the equip type defined in the etype table in the configuration.

 

Don't change the default equip type ID's because the rest of the default scripts rely on that.

If you need to change order, use the Etype_Order instead.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Here is a modified version of Kread-Ex's Actor Inventory script which does not require Ace Equip System.

 

All I did was remove the pre-requisite check and took out all references to YEA equip system.

 

The instructions are the same.

 

 

 

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  â–¼ Actor Inventory
#  Author: Kread-EX
#  Version 1.07
#  Release date: 11/02/2012
#
#  Big thanks to Seiryuki.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#-------------------------------------------------------------------------------------------------
#  â–¼ UPDATES
#-------------------------------------------------------------------------------------------------
# # 01/04/2012. Fixed compat. with various YF scripts.
# # 26/03/2012. Added class conditions for items.
# # 12/02/2012. Fixed critical bug.
#-------------------------------------------------------------------------------------------------
#  â–¼ TERMS OF USAGE
#-------------------------------------------------------------------------------------------------
# #  You are free to adapt this work to suit your needs.
# #  You can use this work for commercial purposes if you like it.
# #  Credit is appreciated.
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
# # rpgrevolution.com
#-------------------------------------------------------------------------------------------------
#  â–¼ INTRODUCTION
#-------------------------------------------------------------------------------------------------
# # Consumable items become equippable and they are only available in battle once
# # equipped akin to the Suikoden series. It offers strategic options as the
# # player has to choose between stats (accessories) or items.
#-------------------------------------------------------------------------------------------------
#  â–¼ INSTRUCTIONS
#-------------------------------------------------------------------------------------------------
# # Requires (yes, I said REQUIRES) Yanfly's Ace Equip Engine. After that, it's
# # pretty plug and play, just select the slot type in the config module. By
# # default, it's 4 (same as accessories) but do whatever you want.
# #
# # <class_locks: x, x>
# # This item notetag allows you to lock items to certain classes.
#-------------------------------------------------------------------------------------------------
#  â–¼ COMPATIBILITY
#-------------------------------------------------------------------------------------------------
# # Obviously enough, needs to be placed below Ace Equip Engine since it's needed.
# # Ace Battle Engine on the other hand is optional.
# # Numerous overwrites make this script incompatible with battle scripts that
# # changes how items behave in battle.
# #
# # List of aliases and overwrites:
# #
# # DataManager
# # load_database (alias)
# # load_actinv_notetags (new method)
# #
# # RPG::Item
# # etype_id (new method)
# # params (new method)
# #
# # Game_Temp
# # item_equip_index (new attr method)
# #
# # Game_Battler
# # consume_item (alias)
# # consume_equip_item (new method)
# #
# # Game_Actor
# # equippable? (overwrite)
# # sealed_etypes (overwrite)
# # fixed_etypes (overwrite)
# #
# # Game_Party
# # has_item? (alias)
# #
# # Window_EquipItem
# # include? (overwrite)
# #
# # Window_ActorItem (new class)
# #
# # Scene_Battle
# # create_item_window (overwrite)
# # command_item (overwrite)
# # on_item_ok (alias)
# # on_actor_cancel (alias)
#-------------------------------------------------------------------------------------------------

# Quits if Ace Equip Engine isn't found.

#~ if $imported.nil? || $imported['YEA-AceEquipEngine'].nil?
#~      
#~ msgbox('You need YF Ace Equip Engine in order to use Actor Inventory. Loading aborted.')

#~ else

$imported['KRX-ActorInventory'] = true

puts 'Load: Actor Inventory v1.07 by Kread-EX'

module KRX

 ITEMS_ETYPE_ID = 5

 module REGEXP
   ITEM_CLASS_LOCKS = /<class_locks:[ ]*(\d+(?:\s*,\s*\d+)*)>/i
 end
end

#===========================================================================
# â–  DataManager
#===========================================================================

module DataManager  
       #--------------------------------------------------------------------------
       # â— Loads the database
       #--------------------------------------------------------------------------
       class << self
               alias_method(:krx_actinv_dm_load_database, :load_database)
       end
       def self.load_database
               krx_actinv_dm_load_database
               load_actinv_notetags
       end  
       #--------------------------------------------------------------------------
       # â— Loads the note tags
       #--------------------------------------------------------------------------
       def self.load_actinv_notetags
               groups = [$data_items]
               for group in groups
                       for obj in group
                               next if obj.nil?
                               obj.load_actinv_notetags
                       end
               end
               puts "Read: Actor Inventory Notetags"
       end
end

#===========================================================================
# â–  RPG::Item
#===========================================================================

class RPG::Item < RPG::UsableItem
 #--------------------------------------------------------------------------
 # â— Public instance variables
 #--------------------------------------------------------------------------
 attr_reader   :c_locks
       #--------------------------------------------------------------------------
       # â— Loads the note tags
       #--------------------------------------------------------------------------
       def load_actinv_notetags
               @note.split(/[\r\n]+/).each do |line|
                       case line
                       when KRX::REGEXP::ITEM_CLASS_LOCKS
       @c_locks = []
                               $1.scan(/\d+/).each {|i| @c_locks.push(i.to_i)}
                       end
               end
       end
 #--------------------------------------------------------------------------
 # â— Set the etype to the same as accessories
 #--------------------------------------------------------------------------
 def etype_id
   KRX::ITEMS_ETYPE_ID
 end
 #--------------------------------------------------------------------------
 # â— Set parameter gains to 0
 #--------------------------------------------------------------------------
 def params
   [0] * 8
 end
end

#===========================================================================
# â–  Game_Temp
#===========================================================================

class Game_Temp
 attr_accessor  :item_equip_index
end

#===========================================================================
# â–  Game_Battler
#===========================================================================

class Game_Battler < Game_BattlerBase
 #--------------------------------------------------------------------------
 # â— Uses up an item
 #--------------------------------------------------------------------------
 alias_method(:krx_actinv_gb_ci, :consume_item)
 def consume_item(item)
   if SceneManager.scene.is_a?(Scene_Battle)
     consume_equip_item(item)
     return
   end
   krx_actinv_gb_ci(item)
 end
 #--------------------------------------------------------------------------
 # â— Uses up an equipped item
 #--------------------------------------------------------------------------
 def consume_equip_item(item)
   unless !is_a?(Game_Actor)
     @equips[$game_temp.item_equip_index] = Game_BaseItem.new
   end
 end
end

#===========================================================================
# â–  Game_Actor
#===========================================================================

class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # â— Determine if an item can be equipped
 #--------------------------------------------------------------------------
 def equippable?(item)
   if item.is_a?(RPG::Item)
     return false if item.c_locks != nil && !item.c_locks.include?(class_id)
     return false if item.itype_id == 2
     return false unless item.battle_ok?
     return true
   end
   return false if item.nil?
   return false if equip_type_sealed?(item.etype_id)
   return equip_wtype_ok?(item.wtype_id) if item.is_a?(RPG::Weapon)
   return equip_atype_ok?(item.atype_id) if item.is_a?(RPG::Armor)
   return false
 end
 #--------------------------------------------------------------------------
 # new method: sealed_etypes
 #--------------------------------------------------------------------------
 def sealed_etypes
   array = []
   array |= self.actor.sealed_equip_type
   array |= self.class.sealed_equip_type
   for equip in equips
     next if equip.nil? || equip.is_a?(RPG::Item)
     array |= equip.sealed_equip_type
   end
   for state in states
     next if state.nil?
     array |= state.sealed_equip_type
   end
   return array
 end
 #--------------------------------------------------------------------------
 # new method: fixed_etypes
 #--------------------------------------------------------------------------
 def fixed_etypes
   array = []
   array |= self.actor.fixed_equip_type
   array |= self.class.fixed_equip_type
   for equip in equips
     next if equip.nil? || equip.is_a?(RPG::Item)
     array |= equip.fixed_equip_type
   end
   for state in states
     next if state.nil?
     array |= state.fixed_equip_type
   end
   return array
 end
end

#===========================================================================
# â–  Game_Party
#===========================================================================

class Game_Party < Game_Unit
 #--------------------------------------------------------------------------
 # â— Determine if the party possess an item
 #--------------------------------------------------------------------------
 alias_method(:krx_actinv_gp_has_item?, :has_item?)
 def has_item?(item, include_equip = false)
   return true if SceneManager.scene.is_a?(Scene_Battle)
   return krx_actinv_gp_has_item?(item, include_equip)
 end
end

#===========================================================================
# â–  Window_EquipItem
#===========================================================================

class Window_EquipItem < Window_ItemList
 #--------------------------------------------------------------------------
 # â— Determine if an item goes into the list
 #--------------------------------------------------------------------------
 def include?(item)
   return true if item.nil?
   return false if @slot_id < 0
   return false if item.etype_id != @actor.equip_slots[@slot_id]
   return @actor.equippable?(item)
 end
end

#==============================================================================
# â–  Window_ActorItem
#==============================================================================

class Window_ActorItem < Window_EquipSlot
 #--------------------------------------------------------------------------
 # â— Determine if a slot can be selected
 #--------------------------------------------------------------------------
 def enable?(index)
   item = @actor.equips[index]
   item.is_a?(RPG::Item) && item.battle_ok?
 end
 def window_height
   fitting_height(13)
 end
 #--------------------------------------------------------------------------
 # â— Makes the window appear
 #--------------------------------------------------------------------------
 def show
   @help_window.show
   super
 end
 #--------------------------------------------------------------------------
 # â— Makes the window disappear
 #--------------------------------------------------------------------------
 def hide
   @help_window.hide unless @help_window.nil?
   super
 end
end

#==============================================================================
# â–  Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # â— Constructs the item window
 #--------------------------------------------------------------------------
 def create_item_window
   wx = 0
   wy = @help_window.height
   ww = Graphics.width / 2 + 48
   @item_window = Window_ActorItem.new(wx, wy, ww)
   @item_window.height -= @status_window.height
   @item_window.hide
   @item_window.help_window = @help_window
   @item_window.set_handler(:ok,     method(:on_item_ok))
   @item_window.set_handler(:cancel, method(:on_item_cancel))
 end
 #--------------------------------------------------------------------------
 # â— Selects an item
 #--------------------------------------------------------------------------
 def command_item
   @item_window.actor = BattleManager.actor
   @item_window.refresh
   @item_window.show.activate.select(0)
 end
 #--------------------------------------------------------------------------
 # â— Validates the item selection
 #--------------------------------------------------------------------------
 alias_method(:krx_actinv_sb_oio, :on_item_ok)
 def on_item_ok
   $game_temp.item_equip_index = @item_window.index
   krx_actinv_sb_oio
 end
 #--------------------------------------------------------------------------
 # â— Cancels the actor selection
 #--------------------------------------------------------------------------
 alias_method(:krx_actinv_sb_oac, :on_actor_cancel)
 def on_actor_cancel
   krx_actinv_sb_oac
   @status_window.show
 end
end

# YEA compatibility

#===========================================================================
# â–  RPG::Item
#===========================================================================

class RPG::Item < RPG::UsableItem
 # Lunatic Parameters
 def custom_parameters
   if @custom_parameters.nil?
     @custom_parameters = {
     0 => [], 1 => [], 2 => [], 3 => [], 4 => [], 5 => [], 6 => [], 7 => [] }
   end
   @custom_parameters
 end
 # Skill Restrictions
 def warmup_rate; 1; end
 # Skill Cost Manager
 def hp_cost_rate; 1; end
 def gold_cost_rate; 1; end
 def tp_cost_rate; 1; end
 def cooldown_rate; 1; end
 # Element Reflect
 def element_reflect; []; end
 # Element Absorb
 def element_absorb; []; end
end

#~ end # Parent script check

 

 

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Etypes =
{0 => ["Weapon", 1],
 1 => ["Shield", 1],
 2 => ["Headgear", 1],
 3 => ["Bodygear", 1],
 4 => ["Accessory", 1],

 #extended equip types
 5 => ["Boots", 1],
 6 => ["Belt", 1],
 7 => ["Back", 1],
 8 => ["Ring", 2],
 9 => ["Gloves", 1],
 10 => ["Leggings", 1]
 }

 

For the left-ring, right-ring...hmm I'm going to have to think about how that will be implemented.

I also found a bug where the "Default order" was not kicking in when you didn't set up the custom order properly.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Ok this is rather odd I have another party member and when to open his/her equipment and the game crashed with an error

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

Why would it crash like this?

 

-=Quick Edit=-

 

As for the R-Ring and L-Ring I figured out how to do it.

I have them set to slot 8 and 9

if you have a ring created in the armor tab set in the note

<fp:es etype 8> and <fp:es etype 9>

if you have two ring slots

Edited by Xigos The Xelor Sandglass

Share this post


Link to post
Share on other sites

Is it like, a second party member? or maybe a 5th? Or does it only matter that it's another party member in general?

There might be some initialization issues that I have not considered. Let me know how to reproduce it.

Share this post


Link to post
Share on other sites

Hmm, well if anyone runs into the issue maybe they can try and reproduce the error. I'm assuming it has to be a bug in my script.

 

Oh and I didn't know you could specify multiple etype id's lol that's cool.

Share this post


Link to post
Share on other sites

I ran into again, this time it was once one of my party members leveled up, I wanted to change out an item

I had him equipped with and the same error popped up leading to line 188.

 

-=Edit=-

 

Here is the error it gives

undefined method 'etype_id' for #<RPG::Item:0x8b99db4>

Edited by Xigos The Xelor Sandglass

Share this post


Link to post
Share on other sites

I know what the error was.

I was playing around with the actor inventory, where you can equip items to use in battle.

 

But then I accidentally changed the method that was supposed to filter out items and stuff lol

Share this post


Link to post
Share on other sites

Hi,

 

I don't know why it seems I am the only person who got this little "bug" but I will report it.

I've tested your script with and without Yanfly equip script, it works but something strange thing appear next to the stat numbers.

 

41d485c3c0663c540791a7909a918t.jpg

With Yanfly script

 

996e2bf8ad5c1dc51020f30ddc4e9t.jpg

Without Yanfly script.

 

 

I didn't touch anything in your scripts :

 

** FP Inventory Plus

Author: Tsukihime

Version: 1.2

Date: May 17, 2012

 

** Equip Levels

Author: Tsukihime

Version: 1.0

Date: May 14, 2012

 

** FP Equip Slots

Author: Tsukihime

Version: 1.1

Date: May 15, 2012

Edited by Chaos17

Share this post


Link to post
Share on other sites

It seems it's from the equip slot script because I've remove it and I didn't get this little bug.

Edited by Chaos17

Share this post


Link to post
Share on other sites

Delete the Window_EquipStatus class and see if it still happens.

That is the only part that I can think of that might be causing problems, although it doesn't make sense to me.

Share this post


Link to post
Share on other sites

I think it may be my system encoding that's causing issues with the arrow.

For example, your computer may be rendering it different.

 

Go to line 210 and you should see

 

 def draw_right_arrow(x, y)
   change_color(system_color)
   draw_text(x, y, 22, line_height, "→", 1)
 end

 

Check what symbol is being used. If it's not → then make it so.

 

I saved the text file in ANSI but maybe I should have used UTF-8

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Hi,

 

This is an idea for you, because I've teste a Rune script and I though something similar may be nice for your script.

The idea is to be able to equip Rune (or whatever player wish) directly in the equip menu and not to have to go to a special menu and to have to unequip the equipement.

When a player equip a slotted equipement (Kraed original Rune script make easy to setup things with notetag) a new slot will be created automaticly for the rune so player will be able to equip directly the rune on that slot (maybe some hide or show option so the equip menu won't be spammed?)

Example :

ammo1.png

 

Rune script : http://grimoirecastle.wordpress.com/rgss3-scripts/gameplay-scripts/runic-enchantment/

Amno script (see screen above) : http://rmrk.net/index.php/topic,45699.0.html

 

Well, that's just an idea and that's probably really though to do it... Sorry for my bad english.

Share this post


Link to post
Share on other sites

Not really, it's usually restricted to weapons and armor but you can extend it to accessories if you like. Ragnarok online, has slotted equipement (ex: accessory, earrings. Sloted earring costed million of gold in that game lol) when instead of Rune you have cards.

Kraed made that with notetag that player can setup like this :

 

The equipment piece

By default, you can’t enchant equipment at all. In order to enable it, you need to tag your weapon or armor using their notebox:

<enchant>

Additionally, you can specify the number of rune slots:

<rune_slots: x>

There is a default slot number that you can modify in the script configuration part:

RUNE_SLOTS_MAX = 5 (the default layout can support up to 5 runes).

 

The runes

For convenience, runes are in fact armor type items with the <rune> notetag. Make sure that their armor type is set to None so they won’t be able to be equipped. Now give to the rune whatever trait you want – every trait will be passed to the equipment piece. The default layout only displays 5 traits but even if you use more, they will all be active.

Three more options exist:

<weapon_rune>

<armor_rune>

These two tags make a rune weapon or armor-exclusive.

<unique>

This tag prevents inscribing two times the same rune on the same piece.

 

But something missing from his script, it how do you know that you're equipement is sloted ?

Usually in games they display available slots in the equip menu like in Xenoblade.

4a81b46d6d-xenoblade-wii-40936.jpg

That's the idea I suggested you because of your slot equip script.

Edited by Chaos17

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.