Hey all,
I've got some time off this summer and would like to put some energy into making a survival type game. I've been working on the inventory system (since that will be a huge part of the game) first. Through Ryan Laley's tutorials I've come pretty far, and with some advice of some redditors i've expanded his system to incorporate instanced structs, which I'm happy with and are work properly.
However, I've now hit a wall and believe I have to redesign from the ground up.
Ryan's system does not seem to support or anticipate a nested inventory system -- for example, the player equips a bag, which contains a gun, which contains a magazine, which contains bullets. A more annoying example might be if I want to put a bag inside of a bag.
I am quite dismayed to find that in unreal, structures cannot contain themselves.
After doing some goggling, people seem to think that an object oriented method might be straightforward, but I'm lost on how the object tracks into an inventory. For example if an actor has an Object_ItemData, then I add the Object_ItemData to an array and delete the actor since it has been picked up, it appears that I've also deleted the Object_ItemData.
My last resort will be trying to deconstruct some pre-existing inventories on the market, but I feel like that might turn into an expensive rabbit hole.
So I guess the question is, what is the simplest way to achieve a nested inventory. I'm really hoping there is something obvious I've missed since these types of inventories are in plenty of different games!