How to have multiple inventory and a share inventory at the same time?

Yannick

New member
As requested on Discord, I will explain what I am trying to do here. I have 3 characters existing at the same time in the same world (same scene) and each have their own inventory. We access it from the same main menu in which you can see 3 vertical panels (buttons) that opens up the individual inventory of the character being controlled. When you control character A, if B and C are too far away, their panels are disabled (but visible) and when they are near, they are accessible. You can move items from one inventory to another. When more than one character is accessible, you also have access to a shared inventory where you can see all items and equipment in one panel with the name of its owner.

The controller is UCC and I use Rewired. Not sure yet how to connect the inventory with Rewired. I need a rpg style inventory similar to FF15 and the likes. I saw there was one but the video tutorial only shows how to use the one with complex grid shapes...

Right now, I have set the inventory on a "Game" game object from the wizard and the one I was supposed to set on a character is on another empty game object not at all connected to the player at this time. Not sure how to set this up on 3 characters since from the wizard, you can only set it on one and not an array of character...

How should I proceed to set this up?
 
(Next time you can post in Ultimate Inventory System -> Integrations -> Ultimate Character Controller)

I see...
This is quite different from the usual use case so you may be required to write some custom scripts to stick everything together.

The way I would do it is set up each character individually with their own Inventory. This way they can each use the UCC+UIS bridge to equip items.
Then I would have a shared Inventory somewhere else on an empty gameobject.

Make sure you set up each character correctly using the integration package, for the UIS+UCC to work nicely together: https://opsive.com/support/document...oller/integrations/ultimate-inventory-system/
(We are working on improving the integration in the coming months.)

I would have a custom script that listens to the items being added (picked up) by all characters. If that item is a shared Item you could intercept it and send it to the shared Inventory.

In the UI you would want to setup at least one Inventory Grid for the shared inventory. And then have multiple Equipment panels one for each character. You can make that using the UI Designer Editor.

Make sure to use the ItemIdentifier component with a different ID for each character and the shared inventory. And make sure that each UI point to the correct character.

I assume this will be a single player game? If so use the shared Inventory a the panel Owner.
For couch coop you may need multiple canvases on for each player

Rewired is not officially supported by UIS yet, we are working on fixing that in the next UIS update (I will probably be a breaking change for the Input). A few people are using Rewired with UIS right now by replacing the InvnetoryStandardInput script by a custom script.

We haven't had anyone use multiple UCC characters with UIS before, so you may run into some limitations. When you do let us know and we'll guide you in the right path.

I hope that helps
 
Top