Store many different kind of variables in same array

Hello,

So i am working on a save system for my game and to make the save game more suited for my game what i want to do is save different types of variables and with minimum effort. what i want to do is add all the variables in a some sort of array or something that can store all the variables i want to store and many of those variables will have different data type obviously. i feel consolidating things in a single array and then saving is cleaner. so does a variable of this type exists.

Also What exactly is FArchive? i wasnt able to understand from the docs.

A Struct can store different types. There is a limit in blueprint as to how many types can be in one struct (I think it is 50 in Blueprint). Structs should group variables that belong together so it doesn’t just become one giant list of “stuff”. Then if you have Structs within Structs you can have a lot of types clustered together.

Widgets use a lot of structs within structs if you want to look at an example.

Structs will be what you are looking for. A struct is a “data type” you define yourself.

For instance, create a struct called “item”. Each item is a fixed set of, for instance:
String name
String itemType
Int itemLevel
Int itemValue

You can then make an array of “items” that hold your inventory data.

Here is what I use to store items. As you can see, my struct also contains other structs, like weapon data, armor data etc.