Multiple Inventories
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.
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.
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.
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.
Hey Hime! Would like to use your plugin for commercial use. Let me know the terms and conditions for that 🙂
it said i need to contact you for commercial usage, I’m not sure whether or not I’m going to sell my game but I might.
Hello! Thank you for the amazing plugins. I would like to use this in my commercial project; proper credit will be given!
Hey Himeworks, this is a fantastic plugin, though I’m having an issue with compatibility. I am willing to pay somebody to make a fix.
I made a post please take a look if you have the time.
https://forums.rpgmakerweb.com/index.php?threads/creating-actor-specific-and-limited-capacity-inventory-mostly-done-just-need-some-help-please.140558/
I have created actor specific inventories using this multi inventories plugin, and those inventories have limited capacities using draconis inventory limiter, and all is working great. The only problem comes up with my workaround for only being able to merge inventories. with waynee95 storage system plugin I can move specific items into there, change active inventory, and take the items back thus moving items without merging. the only problem is the UI, within waynee95 storage system it does not show the backpack capacity from draconis limiters, it only shows the waynee95 storage system capacity. I understand I am posting here basically asking for help with two plugins that are not your own, though I thought since your plugin was involved I would drop this here anyway. Anyway thanks for the epic plugin and have a great day
Hello. Just wanted to ask is there a way to copy over an inventory? Like lets say I want to keep the content of the old inventory before I merge it. I would create a new inventory and add the content of the old one in the new one before preforming the merge…. Guess that is pretty similar to a merge huh?
The idea is that my game will have multiple parties doing their own thing. Some will always be grouped together other will join temporarily and then leave. Actually is it possible to have both inventories separated but active at the same time? Like the menu showing Items -> InventoryA InventoryB. You should be able to pick one of them to view? Once the party separates again you can then separate the inventories safely. But guess that would leave the problem of who will get what loot…. Maybe make one of the inventories (main) so that all loot and money goes to it and add the ability to transfer items between the active inventories ingame?
Hello!
I love this script.
There only seems to be one problem. It is not compatible with Yanfly Game + script for MV. When you attempt to make a Game + game, it crashes.
Hello…I´m new to all of this. i really have no Idea how I am supposed to downloud that Plugin…
Hello…I´m new to all of this. i really have no Idea how I am supposed to downloud that Plugin…
EDIT: I was able to download it…But i still dont know how I am suppused to know where i can change the Inventory name
I’m left to assume you’d use a Script (not a Plugin Command) to create an inventory:
$gameParty.createInventory(“first_inventory”);
Then you can switch to it with a Plugin Command:
switch_inventory first_inventory
Update: the Script should be this, so that you can use the inventory you just made:
var inventory = $gameParty.createInventory("first_inventory");
$gameParty.saveToInventory(inventory);
I would like to use this plugin for a game I’m making for an event. How do I get proper credentials for it?
The plugin don’t work with me …
I do the switch for a team and i switch to another inventory and i switch to an other inventory and my inventory don’t work .
First, this plugin is awesome. I love it.
However, I have a question, I plan to change inventory when I change the leader of party, I successfully did part of it , but I need to close the menu and reopen to change the inventory.
Is there any way to activate it during menu?
Just like the “Global Common Events” you made for another version can just fix my problem( but I’m using MV).
Thank you.
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?
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!
How are you creating the second inventory?
I just wrote: “Plugin command: switch_inventory actor2”
See if the error occurs when you disable all other plugins.
I’ve tried turning off all other plugins and the error still occurs. Are there other ways to set up a new inventory?
No, I made it so that switching to an inventory automatically creates the inventory if it does not exist.
I just tested it in a new project and I can switch inventories without an issue.
If you’ve disabled every other plugin and it still doesn’t work, I’ll have to see how it is set up.
Reproduce the issue in this debug demo and send it to me if it still occurs. http://himeworks.com/2016/01/super-small-debug-demo/
It seems when playtesting from a previous save file from before I had added the plugin. When I played the game from a new game the plugin worked perfectly! Thank you so much for you help!
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?
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.
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.
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!
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!
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.
Let me think about how that might be implemented.
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!
Great! I hope you’ll be able to make some nice things 🙂
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)
No, this plugin just gives the party more inventories. Actor inventories will need to be implemented a different way.
Do you know to implement actor inventories?
Omg!! Do you have party-manager coming up!?! I really cant wait! Thank you Hime!!
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
If you have anything else you need just let me know and I can look into it.
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)
Huh… I guess the comment did work? Well, sorry. You can delete this comment if you want! 🙂