Dev Log: Quick Slot Inventory
Quick slot inventory system functionality
After a long struggle, I finally have a functioning quick slot inventory system! It isn’t perfect, but it’s a huge improvement over the previous state of the game.
The quick slots allow a Player to easily access key items without having to open their inventory. This makes farming, building, healing, and other repetitive tasks fast and easy. They also provide bonus inventory space without needing to adjust the existing inventory sizing/formatting.
To use quick slots, the Player must first assign items via the main inventory. This is done by opening the inventory, then left clicking and dragging items from any inventory slot into a quick slot (or using the selection button for controllers). When an item is selected to move, a ghost icon will follow the Player’s mouse to indicate that it is active. If the item is released in an empty quick slot, the original inventory slot is emptied and the item(s) are reloaded in the selected quick slot. If the quick slot is already occupied, then the items are swapped. In either scenario, the item that was moved becomes the active item - as indicated by a highlight on the inventory slot and the item icon held in the avatar’s offhand. Quick slots can’t be moved when the main inventory is closed.
While developing this feature, I had to work through many layers of issues. My first (and biggest) problem was that the quick slot menu is not directly connected to the inventory scene. Before adding quick slots, I’d created the main inventory in its own scene so that it could be hidden when not in use. I didn’t want to add the quick slot menu into the inventory scene because it wouldn’t always be visible, so I added it to the user interface scene, which also houses the resource inventory, status bars, and mini map. This became a problem because, while both scenes leverage inventory slot subscenes, only the inventory scene had the functions needed to respond to button inputs. To add even more complexity, I wanted the quick slot buttons to respond differently to inputs based on whether or not the main inventory was open. My solution was to create a clone of the quick slot inventory that is housed in the main inventory scene. Even though it looks identical to the user interface quick slot menu, it follows the main inventory button logic, rather than the UI button logic. That wasn’t the end of my problems, but it solved the issue of button inputs not registering.
Various quick slot bugs
I could write a whole novel about the struggle of getting my quick slot system to its current state, but I’ll save that for another time. Maybe when I’m ready to work on manual delete functionality. Until then, I’m happy to move on to tutorial design and audio!