Multiple Inventories

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

Ever needed to manage multiple inventories? For example, you have two actors in your game, but they are in two different locations. To make this more realistic, you would like each actor to have their own inventories, such as their own weapons, armors, items, and gold.

This plugin provides functionality that will allow you to manage your inventories using events.

When you’re switching between actors during your game, you can also switch the current active inventory, and the game will handle all of it for you.

Do your actors come together later on? You can also merge their inventories together with a simple command.

Download

Plugin: download here (right-click, save as)

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the MultipleInventories plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

(日本語の説明はこちらです)

Inventory Names

This plugin uses “names” for each inventory. Let me explain what an inventory “name” is.

A name is any word or number (or any combination of words or numbers) that doesn’t contain a space. For example, you could call your inventories

  • 1
  • 2
  • actor1
  • actor2
  • main_inventory
  • sub_inventory

And so on. You are free to choose any name as long as it doesn’t contain a space. However, you must also ensure you are consistent with things like upper-case/lower-case and so on.

Default Inventory Name

In the plugin manager, you have the ability to set a “default” inventory name. This is the name of the inventory that will be used when the game begins.

MultipleInventories4

It is not necessary to set this: you can simply switch inventories at the start of the game if you wish to use a specific name. However, you have the option to do so.

Switching Inventories

To switch inventories, use a plugin command

switch_inventory NAME

Where the NAME is the name of the inventory that you would like to switch with. Here is an example from the video that shows me switching to a second actor, and switching the inventory as necessary.

MultipleInventories2

Merging Inventories

To merge inventories, use a plugin command

merge_inventory NAME1 into NAME2

Where NAME1 and NAME2 are the names of the inventories that you want to merge. Here is an example from the video that shows both actors joining together and, consequently, merging inventories.

MultipleInventories3

Please note the word “into”: when you merge inventories, you are literally merging NAME1 into NAME2. NAME1 will then be deleted, and you are left with only NAME2.

You will run into problems if you try to merge your current inventory into another inventory, so always make sure your current inventory is NAME2.

 

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

25 Responses

  1. a clown says:

    hey, first of all this plugin is an amazing idea to begin with, but is it also possible to send specific items from one inventory to the other instead of just merging?

  2. Arielle Kim says:

    Hello Hime,

    I’m having some trouble with this script. I can’t seem to create the second inventory correctly and keep getting a typeError: cannot read property ‘undefined’ of undefined. Are my other scripts causing this error or am I missing something when creating the second inventory.

    Thanks!

  3. Feldherren says:

    So for a project I ended up writing a plugin to calculate the total value of items stored in an inventory. I’ve got two questions related to this:

    First, I’ve only managed to get my plugin working with your inventories; it won’t work with the default inventory, as as far as I can tell it just doesn’t exist in the same form. I’ve attempted to piece together something similar to your format, but have had no luck. Is there a reasonable way to construct an equivalent inventory-type structure from the default? (Or have I missed something and it’s there, somewhere, in that form already?)

    Second, are you interested in listing plugins adding functionality to or based on your own plugins for MV plugins, like you did with some VX Ace scripts?

    • Hime says:

      I am deprecating multiple inventories in favor of my new Inventory Core system, which will provide support for multiple inventories along with other inventory functionality.
      I would highly recommend taking a look at it instead.

      http://himeworks.com/2016/03/inventory-core/

      It builds on the idea of having an object to represent the inventory, but this time it’s a full-blown class.

      The default inventory is just a bunch of individual properties in Game_Party. If you look up initAllItems you can see how it’s defined. It makes it difficult to write modular code because you wouldn’t be able to just take a nice “inventory” object as the parameter, which is why I decided to go with the new inventory system even if it will likely break compatibility with existing inventory plugins.

      Yes, I also post up plugins that others have written that will add functionality to any of my own plugins.

      • Feldherren says:

        Yeah, that’s what I found. I tried to construct an equivalent thing but I ran into something that seems to be an iteration issue with the default inventory’s armor in inventory, for example. That or it didn’t track item amounts the same way.

        Inventory Core looks good. As far as I can tell it’s the same structure Multiple Inventories uses, which means what I’ve written may only need to be changed to cope with getting at Game_Inventory and the various things under Game_Inventory. I’ll let you know how it goes there, I guess; thanks for the heads up.

  4. Nev says:

    Oh my god, this plugin is a lifesaver. I was starting to panic that there wasn’t something like this available for MV yet which would make my game’s story impossible. Thank you so much!

    • Hime says:

      Glad this helps! If you can write an article about how you’re using this plugin your own project I can include a link to it in the post for others to read!

      • ineedhelp says:

        Hello HimeWorks, can you make a plugin for rpg maker mv about this: http://www.rpgmakervxace.net/topic/20259-toggle-message-box-visibility/
        Answer for these questions:

        Should players be able to do anything when the box is hidden? -No.

        What happens if I press a key that is not the toggle button, when the message box is hidden? -Nothing happen, or the message box show up.

        What if I want to skip the scene while the message box is hidden? -No.

        This will be awesome if you can hide battle menu boxes during chars/enemy skill animation. Thank you very much for your hard work. I appreciate your help.

  5. M says:

    Thank you so very, VERY much for this!

    I wasn’t sure whether to buy MV or not but your efforts and Yanfly’s are most appreciated and basically made me have no regrets buying it.

    Love your work, keep it up!

  6. Einherijar says:

    hi just wanted to know can this be used to allow every party member to have their own bag perse?

    like you have a main inventory, and each character has thier own that is brought into battle, which you can limit the amount each character can take with them (like each character can carry 15 items with them into battle)

  7. Kloe says:

    Omg!! Do you have party-manager coming up!?! I really cant wait! Thank you Hime!!

  8. Vandril says:

    Hime, I love you for this. I have a WIP game from Ace that I’m trying to remake and continue on MV that used your Ace script for this. I was pulling my hair out trying to figure out how to do this manually, since this script wasn’t around for MV yet and possible never would have been.

    Thank you so much for making this script when you did. XD

  9. David says:

    I don’t want to sound annoying but I cant access this from anyone BUT the YouTube page…
    Other than that this plugin is AMAZING! I cant WAIT for the multiple party plugin! (as i’m hoping since that sorta makes sence if this is a plugin)

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax