Jump to content
UnknownUser1

Adding Items (Accessories) to additional custom equip slots

Recommended Posts

I am adding additional slots to the default VX Ace engine past 4. My new equip slot numbers will be 5 and 6. So my equip_slots currently look like this [2,1,3,4,5,6,0]. I am achieving this with Yanfly Ace Equip Engine script. I am wanting to use the additional equip slot 5 and 6 to add consumable items for my actors to carry in battle and be used with the Actor Inventory script. Currently, I can do this with only equip_slot[4] and want to extend this out to¬†equip_slot[5] and equip_slot[6]. Any help would be greatly appreciated! ūüėÄ

 

Yanfly Engine Ace - Ace Equip Engine

Link: https://github.com/Archeia/YEARepo/blob/master/Gameplay/Ace_Equip_Engine.rb

 

Kread-EX - Actor Inventory:

Link: https://raw.githubusercontent.com/Archeia/RMVXA-Script-Repository/master/Kread-Ex/RGSS3 Scripts/Gameplay Scripts/Actor_Inventory.rb

 

*Yes I could just make my equip_slots [2,1,3,4,5,6,0] to [2,1,3,4,4,4,0] instead, but I have some other logic going on with some scripts hence why I need the slots to have different ID's.

 

or

 

Is there a way to duplicate the equip_slots[4] to represent different slot names instead of going after an .id. So, my example is currently...

 

Extra: Potion

Extra: Water

Extra: Hi-Potion

 

I want it to look like the below as an example. A way to distinguish the slots from each other (Different slot names).

 

Extra: Potion

Extra 1: Water

Extra 2: Hi-Potion

 

Edit 2: I have resolved the issue "technically". Due to other scripts with Kread-EX Actor Inventory, my consumption of items were not being removed from the slot. It was just showing disabled after usage. Same went for item charges from Selchar Item Charges. I dug through the ruby code for removing equipment and found "discard_equip" command and my solution is below. This is under the "use_item" in Scene_Battle. But, I am still needing a way of identifying if any items are attached to the accessory slots... because I want to disable the party command in battle for the actor items if nothing is attached. But, since the accessory equip slot is #4... it will only read one slot as 4 and the other two as blank.

 

Spoiler

	# Checks Party Actor 1 for Item Used
    if $game_party.members[0]
      if $game_party.members[0].equips.include?(item)
        if item.current_charge == 2 or item.current_charge == 1
          # Do Nothing
        else
        $game_party.members[0].discard_equip(item)
        end
      end
    end
    
    # Checks Party Actor 2 for Item Used
    if $game_party.members[1]
      if $game_party.members[1].equips.include?(item)
        if item.current_charge == 2 or item.current_charge == 1
          # Do Nothing
        else
          $game_party.members[1].discard_equip(item)
        end
      end
    end
    
    # Checks Party Actor 3 for Item Used
    if $game_party.members[2]
      if $game_party.members[2].equips.include?(item)
        if item.current_charge == 2 or item.current_charge == 1
          # Do Nothing
        else
          $game_party.members[2].discard_equip(item)
        end
      end
    end
    
    # Checks Party Actor 4 for Item Used
    if $game_party.members[3]
      if $game_party.members[3].equips.include?(item)
        if item.current_charge == 2 or item.current_charge == 1
          # Do Nothing
        else
          $game_party.members[3].discard_equip(item)
        end
      end
    end
    
    # Checks Party Actor 5 for Item Used
    if $game_party.members[4]
      if $game_party.members[4].equips.include?(item)
        if item.current_charge == 2 or item.current_charge == 1
          # Do Nothing
        else
          $game_party.members[4].discard_equip(item)
        end
      end
    end
    
    # Checks Party Actor 6 for Item Used
    if $game_party.members[5]
      if $game_party.members[5].equips.include?(item)
        if item.current_charge == 2 or item.current_charge == 1
          # Do Nothing
        else
          $game_party.members[5].discard_equip(item)
        end
      end
    end

 

 

Edited by UnknownUser1
Adding more information for assistance

Share this post


Link to post
Share on other sites

I'm a little confused, because it looks like you posted a solution, but I guess that was only for the actor inventory.

Having equipment slots different is completely possible. I have 12 equipment slots in my game and two of them are rings (one for each hand). But I also have gloves/gauntlets.

The slot name will change depending on what I specified in the actor note box.

SO...

What do you have set up so far?

I've developed a complex armour system, so for me I have 90 armour terms, 15 slots and all equipment specified into those terms with note tags for the categories for the equip script.

For example,

a warrior would have     and      a magic user would have

<equip slots>                                <equip slots> 
Weapon                                           Weapon
Shield                                               Charm
Headgear                                        Headgear
Bodygear                                         Bodygear
Belt                                                   Belt
Cloak                                                Cloak
Necklace                                         Necklace
Gauntlets                                        Gloves
Greaves                                           Pants
Boots                                               Boots
Ring                                                  Ring
Ring                                                  Ring
</equip slots>                              </equip slots>

 

with the armour note tag for example

<equip type: 4>
<category: Heavy Body>

 

Then in the equip script you would specify each category

This is where I have 15 types

    TYPES ={
    # TypeID => ["Type Name", Removable?, Optimize?],
           0 => [   "Weapon",       true,      true],
           1 => [   "Shield",       true,      true],
           2 => [ "Headgear",       true,      true],
           3 => [ "Bodygear",       true,      true],
           4 => [     "Belt",       true,      true],
           5 => [    "Cloak",       true,     false],
           6 => [ "Necklace",       true,     false],
           7 => ["Gauntlets",       true,      true],
           8 => [   "Gloves",       true,      true],
           9 => [    "Boots",       true,      true],
          10 => [     "Ring",       true,     false],
          11 => [     "Ring",       true,     false],
          12 => [    "Pants",       true,     false],
          13 => [    "Charm",       true,      true],
          14 => [  "Greaves",       true,     false],
    } # Do not remove this.
    

I use BlackMorning VK equip to show the equip slots better.

 

Edited by roninator2
removed picture

Share this post


Link to post
Share on other sites

I think they wanted some slots to be aliases for others or renaming multibles of the same slot differently or something.

Share this post


Link to post
Share on other sites

Technically you are both right. I am wanting 2 additional slots, but they will only be adding to existing equip_slot[4]. So, it will look like below.

 

By default, this is what you would have in the default system slot wise.

 

Slot 2

Slot 1

Slot 3

Slot 4

 

But, I am essentially wanting a duplication of equip_slot[4] twice with a different name on each one or slot ID. I want the full functionality of equip_slot[4] for consumable items.I turned the console on and did a little logic testing and the game cannot differentiate between the same 2 duplicated slot id. It will only match the logic to one of the slots as equip_slot[4].

 

Slot 2

Slot 1

Slot 3

Slot 4

Slot 4 (labeled as slot 5 or the ability to give a custom name on the slot)

Slot 4  (labeled as slot 5 or the ability to give a custom name on the slot)

 

or 

 

Is there logic to say.. if an actor has any consumable items attached, then enable command. If not, disable command. Is this available? I can take a look myself... inside the engine.

 

Edit: I have threw a little logic together below that I know is technically not correct. But, it gives the general idea what I am trying to achieve (If the above cant be done with slot name or id change). Ideally, for the if condition to check if the item is consumable. I think checking if it is just an item (No armor, weapon), is a good start, but if it is consumable would be key as that is how I am checking for my command. If any consumable items are attached to the actor.

item = item.is_a?(RPG::Item)
if @actor.equips.include?(item)
	add_command("items", :item)
else
	add_command("items", :item, disabled)
end

 

Edited by UnknownUser1

Share this post


Link to post
Share on other sites
6 hours ago, UnknownUser1 said:

I am essentially wanting a duplication of equip_slot[4] twice with a different name on each one or slot ID.

I believe I showed you how to do that.

10 -> ring

11 -> ring

 

Each slot needs to be a different number, but can have the same name which then makes the system think they are the same slot.

Seriously.

My rings are tagged for slot 10, but can be put in slot 11., because they are in the category rings. and slot ring

 

If you use a different name then it will restrict it to that slot only. At least I think so, Still figuring out stuff about this script.

I just changed my armor to have 12 slots from the previous 11 I had. with two new types. So give it a while.

 

I may be wrong, cause if I try to change some stuff it messes up my equipment. Now I'm not sure how I got it to work at all.

 

As for the disable, you would need to use

 $game_party.has_item?(item, true)

*not tested

Edited by roninator2

Share this post


Link to post
Share on other sites
24 minutes ago, roninator2 said:

I believe I showed you how to do that.

10 -> ring

11 -> ring

 

Each slot needs to be a different number, but can have the same name which then makes the system think they are the same slot.

Seriously.

My rings are tagged for slot 10, but can be put in slot 11., because they are in the category rings. and slot ring

 

If you use a different name then it will restrict it to that slot only. At least I think so, Still figuring out stuff about this script.

I just changed my armor to have 12 slots from the previous 11 I had. with two new types. So give it a while.

 

I may be wrong, cause if I try to change some stuff it messes up my equipment. Now I'm not sure how I got it to work at all.

 

As for the disable, you would need to use


 $game_party.has_item?(item, true)

*not tested

 

Okay, so my goal was to try and avoid external scripts and just construct logic within the already supplied game engine ruby code. But, that's fine. I guess my question is, what specific additional equipment slot script did you use to achieve this? I have tried a few and they do not seem to work because they only target the armor/weapon equipment and not items. But, I am willing to give another go.

 

From the the code you provided above, assuming you are using Yanfly Ace Equip Engine possibly? (Or is is actually the "BlackMorning VK equip" script?)

Share this post


Link to post
Share on other sites
23 hours ago, UnknownUser1 said:

I have tried a few and they do not seem to work because they only target the armor/weapon equipment and not items

Ok, I may have made a mistake.

I wasn't thinking of your situation.

What I have is for equipment not items. Sorry, I totally blanked on that piece of information.

Nothing I have would work then, I'm pretty sure.

 

What you need may be a completely new script. Although you can equip items into slots for falco pearl abs.

Which under pearl battler settings -> def update_tool_usage is where it calls the use of the item when the button is pressed.

But I have no idea how it equips the items.

 

You will have to excuse my mistake.

Share this post


Link to post
Share on other sites

No problem. I figured it was something along those line. I understand. For others reading this support request, I have resolved my initial issue in my post and have also posted the code snippet if it helps anyone. But, I am still needing assistance with the second issue.

 

I need to be able to... grab strings from different slot ids or the same slot (4) with a custom name.

 

Slot IDs

Slot 4 - Accessory

Slot 5 - (This would be a custom slot more likely. Just need to make items equippable in this slot)

Slot 6 - (This would be a custom slot more likely. Just need to make items equippable in this slot)

 

or 

 

Slot Names

Slot 4 - Extra

Slot 4 - Extra 2 (The ability provide a custom name)

Slot 4 - Extra 3 (The ability provide a custom name)

 

I am trying to disable my individual actor command in battle based on if any items are equipped in the accessory slot. I currently have no way of doing this due to my current accessory slot is clone 2 extra times and when I try to grab the string from Slot 4, it only grabs from one of the clones. So I need to make additional custom slots. There are a few here available, but I cannot make the items equippable to these custom slots. Is there something from Kread-EX - Actor Inventory script that I am missing to help with the custom slot - the ability to add item to it?

Share this post


Link to post
Share on other sites
20 hours ago, UnknownUser1 said:

if any items are equipped in the accessory slot

I still have no idea how you got that working. What script is doing this for you?

Share this post


Link to post
Share on other sites
1 hour ago, roninator2 said:

I still have no idea how you got that working. What script is doing this for you?

 

This is done with Kread-EX - Actor Inventory script. I have the link to the script on the original post. It allows you to "attach" items to the accessory slot.

Share this post


Link to post
Share on other sites

I myself have no experience at all with the script in question, but yes I know of the gameplay mechanic you're looking to achieve.

My only thoughts would be to take the default script for armors and modify it so that there are three accessory slots. I wouldn't know how to do so, at least, not off the top of my head, but since you're not looking to use a bunch of different scripts, it would be my best offer.

Share this post


Link to post
Share on other sites
On 11/13/2020 at 8:25 PM, PhoenixSoul said:

I myself have no experience at all with the script in question, but yes I know of the gameplay mechanic you're looking to achieve.

My only thoughts would be to take the default script for armors and modify it so that there are three accessory slots. I wouldn't know how to do so, at least, not off the top of my head, but since you're not looking to use a bunch of different scripts, it would be my best offer.

 

If I require an additional script to make this work, then I can look to implement this into my game. I'm pretty good at taking an existing piece of a script and stripping out what I need or at least the logic side. I only like to avoid additional scripts as I am intertwining my scripts and everything together. So, the chances of incompatibility are increasing the further I progress in my game I am developing.

 

The issue with making the accessory slots armor slots, I would then have to alter the existing actor inventory script to read that properly and then I would have the issue where every armor could have the potential to put an item in the slot - which I don't want. The only way around this is by creating a custom slot... and this goes back to what I have already tried and making an easy system to complex at this point.

 

I essentially wanting a way to identify if any items are currently in the accessory slot for in battle - it will then disable the item command if no items are attached. For the armor slots, there is the $game_party.has_item?, but it does not extend to the accessory slot which is bizarre (Unless I am wrong). I need a similar call that will point towards the accessory slot.

 

Edit: I have dug a little further and I am printing the information of @actor.equips[index] to the console. This technically reads each of the duplicated accessory slot normally and will tell me what piece of data is equipped in the slot (item, armor, weapon etc.). I have tried grabbing the name of the equipped with @actor.equips[index].name but, this is not a valid syntax I guess. So, if I could simply grab the correct "name" of the equipment, then I could easily perform some logic to achieve what I want. For example..

 

if @actor.equips[index].name == 'potion'

   # Item command enabled

else

   # Item command disabled

end

 

Something along those lines... So, any help with the correct syntax? (I have also tried [@actor.equips[index]].include('potion') and this does not work... well comes back nil/false.)

 

image.png.159b7be55def171b00c4d7c639aa123d.png

Edited by UnknownUser1

Share this post


Link to post
Share on other sites

Try this and see if it works for you.

Spoiler

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return @actor.equippable?(item)
  end
end

 

This accounts for two more slots like you want. 

           4 => [    "Extra",       true,     false],
           5 => [  "Extra 1",       true,      true],
           6 => [  "Extra 2",       true,      true],
Although in my test 'Extra' still showed up as 'Accessory' Forgot to rename it in the terms

Edited by roninator2

Share this post


Link to post
Share on other sites
2 hours ago, roninator2 said:

Try this and see if it works for you.


module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return @actor.equippable?(item)
  end
end

This accounts for two more slots like you want. 

           4 => [    "Extra",       true,     false],
           5 => [  "Extra 1",       true,      true],
           6 => [  "Extra 2",       true,      true],
Although in my test 'Extra' still showed up as 'Accessory'

 

I appreciate you responding and taking a stab at this. I plugged in the additional parts you have provided and ended up with some errors related to my specific game. Not an issue - I can fix those. So, I did a quick test in a from scratch game and I don't think it is entirely working (More like half working). When I go try to add an item to either "extra 2" or "extra 3", I can select the item to attach, but once I attach.. I get nothing in the slot name wise. The item must be in the slot as no more items are in my inventory after the attach. Is there something I am missing or something additional that needs to be added to this? I guess the bigger question, are you receiving the same result?

 

* I added a screenshot to show what I mean. It looks like I have not added anything in both Extra's, but I have.

 

image.png.f62aaf532f57c15bca3c57eb93db208e.png

Share this post


Link to post
Share on other sites

You're right. I was not thorough enough. The items showed up but they don't equip. And actually they get consumed. So that's why they are not seen.

I'll have to work on it more.

 

This works as far as I can tell, but it still has a glitch.

If you unequip an armour or weapon leaving the slot empty the extra slots will also be removed, except for the accessories slot.

Spoiler

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.is_a?(RPG::Item) && (item.etype_id != equip_slots[slot_id])
      @equips[slot_id].object = item
    end
    return if item && equip_slots[slot_id] != item.etype_id
    @equips[slot_id].object = item
    refresh
  end
end

 

Still haven't fully figured it out.

Edited by roninator2

Share this post


Link to post
Share on other sites

I gave the code you provided above a go and received the same results you did. Very odd behavior. I even was able to get all items attached and then went into battle to use/consume a potion and under this scenario, it also removed the items from the other slots as well. But... it is VERY CLOSE!¬†ūüėÄ

Share this post


Link to post
Share on other sites
10 hours ago, UnknownUser1 said:

it is VERY CLOSE!

I feel good solving this. 

The issue apparently was the refresh. And I missed that Yanfly had code in there for the change_equip method.

Hopefully this is fully working for you.

Spoiler

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  ‚Ėľ Actor Inventory Mod
#  Author: Roninator2
#  Version 1.02
#  Release date: 11/20/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
#  ‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
#               Fixed armour adding to extra slots
#------------------------------------------------------------------------------
#  ‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return false if item.etype_id != @actor.equip_slots[@slot_id] && item.is_a?(RPG::Armor)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && equip_slots[slot_id] != item.etype_id
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item)
        if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

 

 

Just tried it in battle. Works there to. Didn't realize the script changed how items were used.

 

New issue, you can equip accessories into the extra slots, but they don't equip. Currently they get consumed.

Still more to do.

 

I think I got that fixed now

Edited by roninator2
fixed script

Share this post


Link to post
Share on other sites
9 hours ago, roninator2 said:

I feel good solving this. 

The issue apparently was the refresh. And I missed that Yanfly had code in there for the change_equip method.

Hopefully this is fully working for you.

  Reveal hidden contents


#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  ‚Ėľ Actor Inventory Mod
#  Author: Roninator2
#  Version 1.02
#  Release date: 11/20/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
#  ‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
#               Fixed armour adding to extra slots
#------------------------------------------------------------------------------
#  ‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return false if item.etype_id != @actor.equip_slots[@slot_id] && item.is_a?(RPG::Armor)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && equip_slots[slot_id] != item.etype_id
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item)
        if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

 

 

Just tried it in battle. Works there to. Didn't realize the script changed how items were used.

 

New issue, you can equip accessories into the extra slots, but they don't equip. Currently they get consumed.

Still more to do.

 

I think I got that fixed now

 

So, I have plugged in the code on my current game and a from scratch and I would say 99% is correct from what I can see (Haven't done extensive testing). The last 1% would be to have the Slot 5 and 6 to behave like Slot 4 (Accessory). Only allow items and armor that is set to the "accessory" equip to be able to be equipped in the additional Slot 5 and 6. This would fully solve my problem.

 

Edit: The armor that is selectable in the slot 5 and slot 6, when I go to attach, it does not populate in the slot. I think its the similar issue before - being consumed as it disappears forever. Same applies to a weapon (Not that I will use weapons). When I use items, it works as intended. So, as mentioned above... if this slot issue is fixed along with the 1% above, then this will completely resolve my dilemma I am having.

Edited by UnknownUser1
Issue with armor/weapon in slot 5 or 6 (Not populating )

Share this post


Link to post
Share on other sites
7 hours ago, UnknownUser1 said:

Only allow items and armor that is set to the "accessory" equip to be able to be equipped in the additional Slot 5 and 6

I didn't realize this was the desired solution. I had thought you just wanted the items. But...

Fixed.

Spoiler

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  ‚Ėľ Actor Inventory Mod
#  Author: Roninator2
#  Version 1.03
#  Release date: 11/20/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
#  ‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
# # 11/21/2020. added support to have accessories in extra slots
#------------------------------------------------------------------------------
#  ‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
#~     return false if item.etype_id != @actor.equip_slots[@slot_id] && item.is_a?(RPG::Armor)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    if item.is_a?(RPG::Armor) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && (equip_slots[slot_id] != item.etype_id)
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item) || item.object.is_a?(RPG::Armor)
        if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

 

Hopefully this is all

Share this post


Link to post
Share on other sites
5 hours ago, roninator2 said:

I didn't realize this was the desired solution. I had thought you just wanted the items. But...

Fixed.

  Reveal hidden contents


#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  ‚Ėľ Actor Inventory Mod
#  Author: Roninator2
#  Version 1.03
#  Release date: 11/20/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
#  ‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
# # 11/21/2020. added support to have accessories in extra slots
#------------------------------------------------------------------------------
#  ‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
#~     return false if item.etype_id != @actor.equip_slots[@slot_id] && item.is_a?(RPG::Armor)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    if item.is_a?(RPG::Armor) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && (equip_slots[slot_id] != item.etype_id)
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item) || item.object.is_a?(RPG::Armor)
        if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

 

Hopefully this is all

 

After taking a look at my initial post, yes I can see how my original message was not portrayed properly as I was focusing on items in the additional new slots. When in reality, I wanted the additional 2 slots to behave like Slot 4. You can add accessory armor and with Kread-EX Actor Inventory, you can now also add items. 

 

Adding in the new change, I would say I am 99.9% there. Ha. I am able to attach items correctly in the 2 additional slots and armors. But, I have armor that is not the equipment type of "Accessory" and I am still able to add in these additional slots - which I do not want. 

 

I appreciate you looking into this and providing a solution that is technically working at this point. I get the sense you want to move on from this and I don't blame you. I will take a look to try and resolve the the last 0.01% myself to only target "Accessory" equipment for the new slots... unless it is an easy change for you to make at first glance.

 

Edit: I have modified the Window_EquipItem class and plugged in the "# added this in" section at the bottom of the def include?(item). What this does, it essentially removes all the armor from my Slot 4, 5, 6. So, I now have all 3 slots correctly defined for items. But, I want to take that expression a tad bit further and instead of excluding the "ALL" armor, only remove the armor that do not have the equip type set as "Accessory"

 

Here is my equip_slot setup - DEFAULT_BASE_SLOTS = [ 2, 1, 3, 4, 5, 6, 0]

 

Spoiler

#===========================================================================
# ‚Ė† Window_EquipItem
#===========================================================================

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return false if @slot_id > 2 && item.is_a?(RPG::Armor) # added this in
    return @actor.equippable?(item)
  end
end

 

 

Edit 2: I appended the "&& item.etype !=4" on my added in section.. and it seems to work? It can't be that easy! Ha. Logic makes sense if I take a look at it. Will need to ensure all works fine in battle and outside battle with swapping armor around multiple characters.

return false if @slot_id > 2 && item.is_a?(RPG::Armor) && item.etype_id != 4 # Added this in

Edit 3: I originally stripped out the Weapon side of the code you provided, but doing this "removed" the weapon in my weapon slot (Even though it is locked).  To fully complete the solution with the original code you provided roninator2 , I added the 2 additional lines that target my slot 5 and 6. If there is a weapon in the list, return false. Viola! That seems to finish this off. I now have 2 duplicated slots like my Slot 4 and with different IDs. This will allow my to insert logic for my "item" command in battle if a consumable item is attached

return false if @slot_id > 2 && item.is_a?(RPG::Armor) && item.etype_id != 4 # Added this in
return false if @slot_id == 4 && item.is_a?(RPG::Weapon) # Added this in
return false if @slot_id == 5 && item.is_a?(RPG::Weapon) # Added this in

Greatly appreciate the help roninator2! I will ensure all works perfect within my game before closing this request (As I have been doing this test on from scratch demo).

Edited by UnknownUser1
Finally done...

Share this post


Link to post
Share on other sites
4 hours ago, UnknownUser1 said:

I get the sense you want to move on from this

Sort of. Every time I think I got it, it's just not quite there. so it gets frustrating that I didn't find a way to encompass all possibilities.

I'll continue to try, but who knows how long it will take.

 

update*

well that took another 5 minutes. Better than I thought.

Spoiler

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# ¬†‚Ėľ Actor Inventory Mod
#  Author: Roninator2
#  Version 1.03.1
#  Release date: 11/20/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
# ¬†‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
# # 11/21/2020. added support to have accessories in extra slots

# # 11/21/2020. fixed bug with all armour allowed to be added in extra slots
#------------------------------------------------------------------------------
# ¬†‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
¬† # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return false if item.etype_id != @actor.equip_slots[@slot_id] && (item.is_a?(RPG::Armor) ||
    item.is_a?(RPG::Weapon)) && item.etype_id < (item.etype_id2 - 1)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    if item.is_a?(RPG::Armor) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && (equip_slots[slot_id] != item.etype_id)
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item) || item.object.is_a?(RPG::Armor)
        if !equippable?(item.object) || item.object.etype_id != equip_slots
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

 

Edited by roninator2

Share this post


Link to post
Share on other sites
Just now, roninator2 said:

Sort of. Every time I think I got it, it's just not quite there. so it gets frustrating that I didn't find a way to encompass all possibilities.

I'll continue to try, but who knows how long it will take.

 

update*

well that took another 5 minutes. Better than I thought.

  Reveal hidden contents

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# ¬†‚Ėľ Actor Inventory Mod
#  Author: Roninator2
#  Version 1.03.1
#  Release date: 11/20/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
# ¬†‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
# # 11/21/2020. added support to have accessories in extra slots

# # 11/21/2020. fixed bug with all armour allowed to be added in extra slots
#------------------------------------------------------------------------------
# ¬†‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------

module KRX

  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6

end

class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
¬† # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return false if item.etype_id != @actor.equip_slots[@slot_id] && (item.is_a?(RPG::Armor) ||
    item.is_a?(RPG::Weapon)) && item.etype_id < (item.etype_id2 - 1)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    if item.is_a?(RPG::Armor) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && (equip_slots[slot_id] != item.etype_id)
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item) || item.object.is_a?(RPG::Armor)
        if !equippable?(item.object) || item.object.etype_id != equip_slots
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

 

 

Yeah, I understand. Every time I felt you were taking a stab at it, I was taking a look in the background myself trying to figure it out. Its just more or less not knowing the syntax or where to start for me. But, once I can figure either one of those out, I can usually resolve my own issue and progress further.

 

Not sure if you noticed, but I did already resolve my issue¬†ūüėĬ†So, I will do a test between my inserted code and yours to see if I see any negative effects from either one.¬†

 

As mentioned, appreciate you jumping into this and helping resolve this. Definitely much appreciated! This is now resolved and can be closed down.

Share this post


Link to post
Share on other sites

I'm glad to see that this came to a resolution.

There are many, many other help threads that are unresolved and dead, it's sad.

I'll also be archiving this and adding a link to this topic in the archive.¬†ūü§ėūü§ė

 

Share this post


Link to post
Share on other sites

@PhoenixSoul @UnknownUser1

Here's another mod.

 

This one lets you use the weapons and armour as items or skills.

Spoiler

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  ‚Ėľ Actor Inventory Mod for Kread-Ex script
#  Author: Roninator2
#  Version 1.1
#  Release date: 11/20/2020
#  Last Updated: 11/21/2020
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#------------------------------------------------------------------------------
#  ‚Ėľ UPDATES
#------------------------------------------------------------------------------
# # 11/20/2020. Patch allows multiple equipment slots for items.
# # 11/21/2020. added support to have accessories in extra slots
# # 11/21/2020. fixed bug with all armour allowed to be added in extra slots
# # 11/21/2020. Added option to have equipment act as items or skills
#------------------------------------------------------------------------------
#  ‚Ėľ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  Follow original authors terms of use
#------------------------------------------------------------------------------
#  ‚Ėľ INSTRUCTIONS
#------------------------------------------------------------------------------
# # Put the following notetag on your equipment that will act as if it
# # is an item or skill
# # <equip_uses: 1>
# # Then the equipment will do what a potion does
# # <equip_skill: 26>
# # Then the equipment will do what the skill heal does
# # If both tags are used, the item will be used not the skill.
# # If two of the same tag are used the last one will be used.
#------------------------------------------------------------------------------

module KRX
  ITEMS_ETYPE_ID2 = 5
  ITEMS_ETYPE_ID3 = 6
  module REGEXP
    ITEM_EQUIP_USE = /<equip_uses:[ ](\d+)>/i
    ITEM_EQUIP_SKILL = /<equip_skill:[ ](\d+)>/i
  end
end

module DataManager  
	#--------------------------------------------------------------------------
	# ‚óŹ Loads the database
	#--------------------------------------------------------------------------
	class << self
		alias_method(:r2_actuse_dm_load_database, :load_database)
	end
	def self.load_database
		r2_actuse_dm_load_database
		load_actusearm_notetags
    load_actusewep_notetags
	end  
	def self.load_actusearm_notetags
		groups = [$data_armors]
		for group in groups
			for obj in group
				next if obj.nil?
				obj.load_actusearm_notetags
			end
		end
	end
	def self.load_actusewep_notetags
		groups = [$data_weapons]
		for group in groups
			for obj in group
				next if obj.nil?
				obj.load_actusewep_notetags
			end
		end
	end
end
class RPG::Item < RPG::UsableItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
end

class RPG::Weapon < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
  attr_accessor   :equip_use
  attr_accessor   :equip_skill
	def load_actusewep_notetags
		@note.split(/[\r\n]+/).each do |line|
			case line
			when KRX::REGEXP::ITEM_EQUIP_USE
        @equip_use = $1.to_i
			when KRX::REGEXP::ITEM_EQUIP_SKILL
        @equip_skill = $1.to_i
			end
		end
	end
end

class RPG::Armor < RPG::EquipItem
  def etype_id2
    KRX::ITEMS_ETYPE_ID2
  end
  def etype_id3
    KRX::ITEMS_ETYPE_ID3
  end
  attr_accessor   :equip_use
  attr_accessor   :equip_skill
	def load_actusearm_notetags
		@note.split(/[\r\n]+/).each do |line|
			case line
			when KRX::REGEXP::ITEM_EQUIP_USE
        @equip_use = $1.to_i
			when KRX::REGEXP::ITEM_EQUIP_SKILL
        @equip_skill = $1.to_i
			end
		end
	end
end

class Window_EquipItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if an item goes into the list
  #--------------------------------------------------------------------------
  def include?(item)
    if item.nil? && !@actor.nil?
      etype_id = @actor.equip_slots[@slot_id]
      return YEA::EQUIP::TYPES[etype_id][1]
    end
    return true if item.nil?
    return false if @slot_id < 0
    return false if (item.etype_id != @actor.equip_slots[@slot_id] &&
    item.etype_id2 != @actor.equip_slots[@slot_id] &&
    item.etype_id3 != @actor.equip_slots[@slot_id])
    return false if item.etype_id != @actor.equip_slots[@slot_id] && (item.is_a?(RPG::Armor) ||
    item.is_a?(RPG::Weapon)) && item.etype_id < (item.etype_id2 - 1)
    return @actor.equippable?(item)
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    return unless trade_item_with_party(item, equips[slot_id])
    if item.nil? && !@optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][1]
    elsif item.nil? && @optimize_clear
      etype_id = equip_slots[slot_id]
      return unless YEA::EQUIP::TYPES[etype_id][2]
    end
    if item.is_a?(RPG::Item) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    if item.is_a?(RPG::Armor) && !item.nil?
      @equips[slot_id].object = item
      @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
    end
    return if item && (equip_slots[slot_id] != item.etype_id)
    @equips[slot_id].object = item
    refresh
  end
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      @equips.each_with_index do |item, i|
        next if item && item.object.is_a?(RPG::Item) || item.object.is_a?(RPG::Armor)
        if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
          trade_item_with_party(nil, item.object) if item_gain
          item.object = nil
        end
      end
      return if equips == last_equips
    end
  end
end

class Window_ActorItem < Window_EquipSlot
  #--------------------------------------------------------------------------
  # ‚óŹ Determine if a slot can be selected
  #--------------------------------------------------------------------------
  def enable?(index)
    item = @actor.equips[index]
    return true if item.is_a?(RPG::Item) && item.battle_ok?
    return true if !item.nil? && !item.equip_use.nil?
    return true if !item.nil? && !item.equip_skill.nil?
    return false
  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

class Scene_Battle < Scene_Base
  def on_item_ok
    @item = @item_window.item
    $game_temp.item_equip_index = @item_window.index
    if $game_temp.item_equip_index < KRX::ITEMS_ETYPE_ID && !@item.nil?
      if !@item.equip_use.nil?
        @item = $data_items[@item.equip_use]
        $game_temp.item_equip_index = -1
      elsif !@item.equip_skill.nil?
        @skill = $data_skills[@item.equip_skill]
        $game_temp.item_equip_index = -1
        BattleManager.actor.input.set_skill(@skill.id)
        BattleManager.actor.last_skill.object = @skill
        if !@skill.need_selection?
          next_command
        elsif @skill.for_opponent?
          @item_window.hide
          select_enemy_selection
        else
          select_actor_selection
        end
        return
      end
    end
    if !@item.battle_ok?
      Sound.play_buzzer
      @item_window.activate
      $game_temp.battle_aid = nil
      return
    end
    $game_temp.battle_aid = @item
    BattleManager.actor.input.set_item(@item.id)
    if @item.for_opponent?
      select_enemy_selection
    elsif @item.for_friend?
      select_actor_selection
    else
      @item_window.hide
      next_command
      $game_temp.battle_aid = nil
    end
    $game_party.last_item.object = @item
  end
  def on_enemy_cancel
    if $imported["YEA-BattleEngine"]
      BattleManager.actor.input.clear
      @status_aid_window.refresh
      $game_temp.battle_aid = nil
    end
    if @skill_window.visible || @item_window.visible
      @help_window.show
    else
      @help_window.hide
      if $game_temp.item_equip_index == -1
        @item_window.show
        @item_window.activate
        @help_window.show
      end
    end
    @enemy_window.hide
    case @actor_command_window.current_symbol
    when :attack
      @actor_command_window.activate
    when :skill
      if $game_temp.item_equip_index == -1
        @item_window.show
        @item_window.activate
        @help_window.show
      else
        @skill_window.activate
      end
    when :item
      @item_window.activate
    end
  end
end

 

911546567_useequipment.gif.2fd99b5bf447631fbfae3c94a28634cd.gif

Edited by roninator2

Share this post


Link to post
Share on other sites

Well.. my post information got deleted when I went to edit. Here goes the re-post. I wanted to post my last resolution as I had two issues from my main initial post. Under the "Window_ActorCommand" class and under the "add_item_command", I have placed the code below if it will help benefit anyone else.

 

I had to make the change to not use variables for the equip slots as I needed the slot to refresh at the beginning of each turn to determine if the item command needs to be disabled.

 

Spoiler

   if @actor == $game_party.members[0]
      if $game_party.members[0].equips[3].nil? != true or $game_party.members[0].equips[4].nil? != true or $game_party.members[0].equips[5].nil? != true
        add_command("items", :item)
      else
        add_command("items", :item, disabled)
      end
    end
    
    if @actor == $game_party.members[1]
      if $game_party.members[1].equips[3].nil? != true or $game_party.members[1].equips[4].nil? != true or $game_party.members[1].equips[5].nil? != true
        add_command("items", :item)
      else
        add_command("items", :item, disabled)
      end
    end
    
    if @actor == $game_party.members[2]
      if $game_party.members[2].equips[3].nil? != true or $game_party.members[2].equips[4].nil? != true or $game_party.members[2].equips[5].nil? != true
        add_command("items", :item)
      else
        add_command("items", :item, disabled)
      end
    end
    
    if @actor == $game_party.members[3]
      if $game_party.members[3].equips[3].nil? != true or $game_party.members[3].equips[4].nil? != true or $game_party.members[3].equips[5].nil? != true
        add_command("items", :item)
      else
        add_command("items", :item, disabled)
      end
    end
    
    if @actor == $game_party.members[4]
      if $game_party.members[4].equips[3].nil? != true or $game_party.members[4].equips[4].nil? != true or $game_party.members[4].equips[5].nil? != true
        add_command("items", :item)
      else
        add_command("items", :item, disabled)
      end
    end
    
    if @actor == $game_party.members[5]
      if $game_party.members[5].equips[3].nil? != true or $game_party.members[5].equips[4].nil? != true or $game_party.members[5].equips[5].nil? != true
        add_command("items", :item)
      else
        add_command("items", :item, disabled)
      end
    end

 

 

*Very nice roninator2! To bad this mod was not done when RPG Maker VX Ace was the latest maker at the time. Would of been useful for others.

Edited by UnknownUser1
Fixed item command logic to be disabled.

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.

×