Inventory Pro

Character collection

This tutorial is primarily about getting everything up and running, for a more detailed description on the Equip editor click here. I’m assuming you’ve already created some Equipment types inside the Equip editor.

Setting up the UI

First create a new object inside the Canvas and name it “CharacterWindow”. Next add the CharacterUI component to this object (InventorySystem/Windows/Character).

Because we know how many equip slots there will be, and want to manually define the layout we can define the collection by ourselves. Only allow items of type allows us to limit this collection to a certain time, equippable items in this case, after all equipping a consumable strawberry would be rather odd… even by my standards.

Note that at the bottom, I disabled Can drop from collection, as this likely wouldn’t be desired behavior, as well as Can stack items in collection, as we don’t want our equipment to stack (UFPS users might want to enable it for ammo).

When we enable “Manually define collection”, we’ll have to – you’ve guessed it – manually select the items that we wish to use inside our collection. You can do this by grabbing the UI_Item_PFB object inside the demo folder and drag it inside your Container object in the hierarchy.

Once you’ve defined your layout using the UI item wrappers, select all of them and add the “InventoryEquippableField” component, which you can find under /InventorySystem/UI Helpers/Equippable field. 

The InventoryEquippableField defines a location where a given equip type can be equipped. If you select an item inside your container and look at the InventoryEquippableField component you’ll notice that you can select the previously defined types (inside the equipment editor).

Simply select the item types that are allowed to be stored in the selected slot. For example, for the UI_Item_Necklace object I’ve created an Necklace equip type inside the editor first, and then assigned it inside the inspector’s InventoryEquippableField.

You can mix and match equip types on your equippable fields as much as you like, for example if you wish to allow the player to equip an item 2, 3 or 4 times – let’s say a dagger for example – you can simply create a 2nd UI_Item_* object, or add the “Dagger” type to a 2nd equippable field.

Setting up the player

And last but not least we have to assign the InventoryPlayer component to each player. If you have multiple characters, assign the component to each character. Once you’ve added the component you can associate it with a character window, which is the “Associated Character UI” field.

Also you have to assign the inventories and skillbar, this allows you to create unique inventories per character and switch between characters and it’s inventories whenever you want.

And last but not least, make sure you’ve assigned the items created inside the Container in the Manually Define collection.