Download

Help Loading and Saving

So as the title describes, I need a little assistance with Loading and Saving. I have a multiplayer game that I am currently working on. I have a “Save Game Object” setup with an array of Player states (Player State Class that I made “Master State”) As the player moves around it updates the player state variable “player location”. Every 15 seconds I have a save function called (time is for debugging purposes) Everytime the save function is called I use my “game state” variable that I cast to on “begin play” and call for all “Player Array” player states. I then use a “For each loop” to cycle through those players to compare the “Unique ID” that is assigned to them, with a pre-saved player states array inside my Game Mode. (All of this is being done inside Game Mode by the way) If it finds a match, then it “sets array elem” to equal the Game State’s player array player state. Inside the player state is where the Player location variable is stored. All of this works. Even after I Async Save to Game Slot, I run a for each loop to print off all of the player locations saved inside the player states. However, when I “Async Load from Slot” it returns all the saved player states, except the Player Locations are all equal to 0. (X,Y,Z)

Basically in short: I am running a save funciton to retrieve player states. The player states store a Player Location variable. That variable should automatically save inside the player state? Then When the game restarts and the game mode calls for the Load function, it should return the player states with the player location variables, but instead they just return with the players Unique ID. So I know the save and load are working, however I have no idea why they are not saving my Player Location variables. Howe do I successfully save player states with variables inside of them and then re-load them on start up?