Download

Inventory Categories

Hi all,

I have followed a few tutorials and got a very basic inventory system working where when I pickup an item, the mesh is destroyed and the item is added to an inventory. But I would like to split my inventory into different categories - for example, I want an inventory for weapons, one for armor, one for consumables, one for mission items, etc.

The question I have is do I need to create a single inventory for each category, or can I have one main inventory that has separate categories within and items are separated as they are picked up depending on whether they are weapons, armor, consumables, etc.

Thanks in advance for any tips.

Add an enum to your item class that contains each item type / category, When you populate your inventory menu only add items that match the category you want to display

Awesome! Exactly what I was looking for. Thank you for your help.

I’ve got an enumeration for ItemType which has Primary, Secondary, Special for weapons and Head, Chest, Arms, and Legs for Armor. This enum is added to a structure called ItemInfo. I have the ItemInfo variable added to BaseItem. Then, I created a child of BaseItem for each ItemType. Now I want to add Actors designated as Primary to go into inventory slots for Primary weapons. Does the ItemInfo variable need to be added as a variable inside the Primary slot actor? So when the item is picked up, a check is done to see if the item’s type is equal to the item type for the Primary slot.