Data Asset and Save Game

The problem is you can only have THAT type of struct for your inventory array. Instanced structs would be a solution, but a pain if you want to spawn a certain actor class from your inventory: you have to break the instanced struct into all the possible structs it may hold for EACH element, until you find your class.

And data assets are completely useless for this. Insane that they don’t have a solution for this. An inventory that needs saving is a common thing in video games.

At the end of the day, couldn’t any inventory work as just a map of Data assets (key) to an int (value). The int would be the ‘amount’ of the inventory item represented by the data asset. You wouldn’t even need to save a struct, just the map. Or am I missing something and you’re trying to do something far more complex?

1 Like

yes if the item data isnt mutable (ie durability) and you dont need to replicate it since Tmaps dont replicate

2 Likes