Save and load game not working in packaged game

Jw0ody
Tue, 03 Jan 2023 23:01:20 +0000
Blueprint

Hi, I’m making a tab target RPG using blueprints and have created a slot save system where you can interact with an actor to load a save widget to the viewport with three slots. When you click a slot it saves the game, including all the player variables, location, inventory, quests, learnt skills etc.

This system works perfectly when played in the editor, you can save to any of the three slots, exit to either the start menu or PC and then load up one of the save files flawlessly when restarting the game. But as soon as I package the game up and test it, it no longer works!

I can see that a .sav file is created within the applocal file and there is data within it but it doesn’t load correctly in game. Interestingly, after a lot of testing, I’ve realised that the save does work correctly if you save the game, exit the game, then load it up again, start a new game and resave over that original save. As soon as you save to one of the other empty slots though, the game no longer loads any of the saves correctly.

It’s almost like the game can’t save a fresh .sav file without there being an existing one from a previous session.

For reference, the save functionality is done via a function in the player character that is executed when a save slot is clicked in the save widget. Likewise for the load functionality, which is executed after the player begin play code executes. I’ve tried moving the code to the game mode, as well as installing a save plug-in from the store but still encounter the same issue!

I’ve been stuck with this problem for the last few months and I’m at a loss as to what to do to fix it as searching the web for answers provides no solution. Hopefully one of you will be able to help with my issue. I’m happy to share screenshots of the code if that helps. Thanks!

12 posts - 5 participants