2023-09-18 20_39_28-TP_TidyStarterTemplate - Unreal Editor.png

Tidy StarterTemplate comes with a simple inventory system. This allows you to pick up named objects. Such as a Key, Money or Gold, Swords, Guns, etc, and use them for gameplay mechanics, like buying items, or opening locked doors. Also, Unique Items such as a “Broken Banished Blade”, “Scroll of Dark Secrets”, etc, and using them for gameplay triggers.

Such as,

Entering the hidden basement requires the “Scroll of Dark Secrets”

Progressing through the dungeon requires finding 3 “Key”s.

How it Works

The inventory has several functions to add/remove/check inventory.

It uses a simple Dictionary Variable to add or remove, which is clean and easy to use. It is simply a String/Integer Dictionary, with the String being the item name, and the Integer being the quantity or Amount you have.

2023-09-18 20_33_36-TP_TidyStarterTemplate - Unreal Editor.png

This is it—this function “Inventory_AddItem” and the InventorySimple dictionary-variable is basically the whole inventory. Simple!

2023-09-18 20_50_03-TP_TidyStarterTemplate - Unreal Editor.png

BP_Pickup and Adding Items

There is also a BP_Pickup object that can be used to specify what to add to the inventory upon “Use”. It is dropped from BP_Chest for instance.

2023-09-18 20_42_28-TP_TidyStarterTemplate - Unreal Editor.png

Where the Inventory Lives

The inventory component lives on the BP_PlayerController (not the pawn) called BPC_SimpleTidyInventory, so your inventory will persist between your pawns dying/respawning/changing.

2023-09-18 20_31_56-TP_TidyStarterTemplate - Unreal Editor.png

Here is the BP_GameMode where the BP_PlayerController is selected.