Inventory changes and quickslots


In this post, I'll be going through some changes I've made to the inventory system I talked about in my previous post. I had already limited the amount of healing items the inventory could hold. The idea was to make empty slots appear empty instead of having the default item's info (question mark icon, etc), but I decided to leave them in for now to make it clear that there is an "empty" item.

Inventory with item options, info panel, and quick slots at the bottom left.

Next, I wanted to disable the drag-and-drop and use the item on mouse click features. Those were replaced with pop-up options when the item is clicked. Those options include the features the drag-and-drop had: Use, Drop, Assign to a quick bar slot, and Unassign.

The quick slots at the bottom left corner of the image are created within a container based on the number of desired slots.

Blueprint code creating the quick slots.

Assigning an item to a slot sends a reference of the item slot in the inventory to the quick slot, which then updates its visual information based on that reference whenever there are any changes to the item in the inventory. When the item is used through the quick slot, it tells the reference to use its item.

Reference of the inventory slot is sent to the assigned quick slot.

The dilemma I had with the quick slots was how the player was supposed to use them. As a fan of Dark Souls, I figured I'd just approach it a similar way Dark Souls does: two keys cycle through the quick slots and a third key uses what is in the slot. So I created the necessary functions for that and a function that scales the slot that is currently selected.

Item slot 2 is selected.

Afterwards it kind of felt that this method had an unnecessary amount of effort when each of the quick slots could just have an assigned key, the number keys for example, and the d-pad on a controller. I dropped the number of slots to 4 to fit the d-pad and made input action for each slot.

There is also a notification text that plays when an item is picked up or dropped shown in the clip below which also demonstrates the other features.