WIP - Inventory System

Was playing the Witcher 3 and decided to make an Inventory System akin to it. :slight_smile:

Dude, how did you approach this?
Currently I know of two approaches - “Manually define every single permutation of item sizes across the entire field until you bleed out of your ears” with widget and “build everything, including drag and drop operations, from scratch in primitive HUD”.
I’m almost finished with the latter, but now am stuck thanks to the bug that prevents you from setting members of struct arrays. Which is technically not a bug concerning the UI, but I went with the lazy route to build the display loop.
(As an aside, does anyone know if that’s a blueprint-only bug or if it’s in C++ TArray as well?)

I would love to know if you found some other way. I **need **to know, in fact. My entire game concept hinges on me finally getting it done. I was stuck for three months until I decided to use the primitive HUD, which has basically no documentation/tutorials available but at least works in a fashion that allows you to do things that aren’t explicitly intended by Epic. (Yes, I have a game concept that is unplayable without this kind of inventory)

I mean, I’m almost finished myself, but primitive HUD implementation tends to be more error prone, as I’m doing everything from scratch.

I use a Uniform Grid Panel that holds and Inventory Slot Widget 1x2 and two Inventory Slot 1x1 “stacked” on top the 1x2 slot, so there are 3 widgets for every slot.
Since you can only interact with one widget at a time, what I do is actually turn on/off the corresponding slot based on the size of the item.
So lets say I want to drop an item 1x2 into a slot, I check if that slot’s 1x1 slots are empty then hide them and show the 1x2 slot.
Upon creation, the widget only actually shows one type of slot and the other one is hidden.

Completely reworked the entire thing.

I would love to know if you found some other way. I need to know, in fact .Totally revamped the whole thing.

Yeah, I’m always interested in approaching this stuff.

I think I’ll start to collect my own approaches and post about them, even though none of them have worked yet. Maybe we can throw together a list of ways of achieving this kind of inventory within the limits of UMG.