How would you save items with random stats?

Hey, right now I have an inventory system that only saves the ID number to identify that item in a data table containing all items in the game, and also the amount of items of that kind I have. So when I load the game it adds items from that class with their default stat values.

However, I want to make the enemies drop items with random stats. I can imagine a couple ways to do that, but quite often when I just try and start making systems from scratch, I end up with something bloated and hard to edit or scale.

So how would you do that?

The item that needs saving would be represented by a struct composed of all the bits and bobs that define said item:

image

You save arrays of structs to save those items. When you load the game, spawn actors from class and pipe in the rest of the data.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.