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.
Plugin: download here (right-click, save as)
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.
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
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.
To switch inventories, use a plugin command
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.
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.