[SOLVED!] Confused on how Deleting Storage Works

I’m setting up a save/load function in my game. The idea is they have a single save file, and when it’s saved they can click ‘continue’ from the main menu to proceed, OR if they click ‘start’ (and there’s a save file present) it will delete the save file so they can start over if they want.

With the latest update I’m now having issues where the storage isn’t deleting and I’m trying to troubleshoot it but I also want to make sure I’m fully understanding HOW this delete storage works. (I thought I did but now I’m doubting myself lol)

So for the variable types number, string, and boolean, when you delete storage that they’re saved to, does that erase the information or set them to default? I guess for numbers that were 0 to begin with or strings that were empty there’s not much difference but I want to be sure. And for booleans, does it set that to what its default was or … I’m not really sure to be honest.

The issue I’m suddenly having is when I click the delete key, leave the scene to go to the main menu, and press start its picking up right where I left off in the scene, which wasn’t an issue I had previously. It’s not clearing out the number or string variables that should’ve been cleared when I deleted the storage.

So I just want to be sure I fully understand how this storage and deleting it works so I can better troubleshoot it. I think it’s a bug since it was working fine before the latest update but I want to cover all of my bases. The documentation doesn’t really explain in depth how it works, just that you can delete it. And in the engine it’s called ‘clear storage’ but when you put it in the event sheet it says ‘delete storage’.

I’m also going to try exporting to see if this is just an issue that exists in preview for some reason.

I appreciate any help! :slight_smile:

Yesterday, I tested the storage with a new project. It worked as expected. It loaded, saved and deleted fine.

Clearing storage doesn’t change any existing variables. If you leave a scene and return any global variables will have the same values as when you left the scene. Scene and object variables would have their default values until modified.

I should clarify that. You can pause a scene and return and everything should be as you left. But if you start or restart another scene only the global variables retain their values.

The next time you preview or run the project. The variables should have their default values.

1 Like

So I definitely didn’t realize that clearing storage didn’t clear the existing variables lol But if anyone else stumbles across this thread I shared my solutions (for the resetting as well as why the clearing storage wasn’t working at first) here!

Thanks again Keith!

1 Like