Save Game with custom blueprints/classes
Right now, I'm trying to save a game. I can create a save game with built-in values such as int, float, string, etc. How do I save/load the data of a custom object/blueprint?
For instance, I have a character with health, maxHealth, Exp, etc, all stored in a custom object called PlayerCharacterInfo. I stuff an array of those into a blueprint inherited from Save Game. If I save and load in the same game (without closing it in editor) then the save/load works perfectly. However, if I save, then close the game, then load that save game, everything is value of None. I believe it's saving a reference to the object in the world instead of the data within it. How can I save the data itself, instead of just a reference to it?
asked Feb 24 '16 at 09:40 PM in Blueprint Scripting
use a struct instead of an object. then you can save that struct. object references wont save properly because the pointers are only meaningful during runtime, so fill the struct with basic types, like bytes or ints.
answered Feb 24 '16 at 09:57 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here