Loading from Storage does not work if the scene has not been loaded yet

Say you have an RPG where you can save anywhere in the world

Say you save using “Save to storage” at one place in the world, say at the waterfall location

Your game has a main menu, with “Load” on it.
You quit the game, and come back later, and press “Load”

Upon loading, it does not place you back where you left off. It loads the right scene, but none of your custom data got loaded at all!

However, if you then quit to the main menu and click Load again, NOW all of your save data loads in!

Why does this happen? Why must the scene be loaded one time first before pressing Load, to actually load in your data? How can it be fixed?

  1. Create a main menu with a load button
  2. Change scene to gameplay, Save game somewhere in the scene
  3. Quit game
  4. Load from main menu
  5. The scene properly changes but your data does not load, its fresh
  6. Quit to main menu
  7. Load game again
  8. Now all your data finally loads

I kind of got around it by brute forcing a double load, but this is weird and may have unintended consequences.


Pic 1 main menu load

Pic 2 brute force double load after clicking Load on main menu (load again in the scene)

1 Like

This isn’t a normal behavior, right? Should be under Bug Reports

Hello!

I have not never used this saving function but, reading this post, i deduce that this action depends of the scene where the backup took place.

This been said, so, the remedy would be to preload this scene before to invoke the reloading from storage.
In this way, all would be correct, no?

A+
Xierra

What do you mean? where should this go?

Preloading scenes doesnt fix it

These are conditions you should use for your load event

Normally at beginning of the scene condition makes something happen when scene start and never after

INVERTED at beginning of scene
Trigger once

Makes something happen AFTER scene started

However idk if it will fix your problem cause i never used save state system


Like this? This is the “LOAD GAME” button on my main menu.
This doesn’t fix it sadly, same issue.

It correctly changes the scene, but I am not in the right position
However, if I then somehow “Load game from device” one more time after this
(Say, attach it to “If key press F , Load game from device” as a debug test) , now it correctly loads me in the right place as the scene is already active.

Using a global variable to determine whether to load a saved scene works for me:

In the menu scene for the reload button clicked, use this event (I’m using a button object):

And in each scene that can be saved, use this:

Yes, it’s a bit of a faff to have that in each scene, but it’s a way to get what you’re after.