[Solved] Storage not working when exported to Windows build

Hello, I was wondering if anyone could help me out?

Storage for my game works perfectly when I run it in GDevelop 5’s preview. I can close GDevelop 5, open it again, run my game, and it will load my last score and level. But when I export it, and create a windows Windows build the storage doesn’t work. I cant even get the first level to load. It just stays on my games loading seen.

Here is a screenshot of my games loading events, and actions:

And here is a screenshot of one of my levels where it saves my score, and level:

Any help would be appreciated. I’ve spent the last 4 months working on this game while learning GDevelop 5.

Not sure what’s wrong with your code itself.
Does the Windows build load the first time, then you beat the first level, close it and it doesn’t open again? Or does it never load in the Windows build even with no savefile? (In that case you’ll have to check other stuff)

Some suggestions for you to troubleshoot it:
If exported build allows it (I don’t remember), on the game window, press Ctrl + Shift + I to bring up chrome inspector, then go to Application tab, then delete the savefile(s) so the game can proceed normally. GDevelop 5 save has GDJS prefix.
image
image
If not delete, you can always check/edit to see if they are proper values.

Alternatively, try changing the name for load and save events, so it’ll load a different save when you export and boot it up (since you mentioned it won’t load the first level).

Hi, Cat.

The Windows build does load. I have 3 seen’s before the first level of my game. They are just simple seen’s with no game play involved (Start seen, Credits seen, and Instructions seen). I have the game set up to start level 1 or whatever level was stored after you press the enter key while on the Instructions seen. The game loads up and works until the instructions seen, and when I press the enter key to start level 1 nothing happens.

Thanks for the suggestions. My exported game doesn’t seem to allow bringing up chrome inspector. I can bring it up in preview with GDevelop 5, but not with my exported game build. I also tried changing the name for load and save events, but got the same result.

There’s got to be something simple that I missing if it works perfectly in Gdevelop 5 preview?

Okay, I figured it out!

What I had to do was tell my game what to do if my “Score”, and “Level” didn’t exist in storage.

Everything is working perfect with my Windows build now! I will post a couple before and after screenshot’s below of what I had to change just in case someone else ever has a similar problem.

My games loading events, and actions before:

My games loading events, and actions after:

My game working:

I love GDevelop 5! It’s the perfect game creator for me. :slight_smile:

1 Like

Didn’t think I missed that simple mistake either, but that’s how programming and game development is.
Glad you solved it!

1 Like