Hi. first screen is from level 1, second screen is from start menu. After i beat level 1 i exit and start again, but when pressing resume nothing happens. Thank you.
Try doing read lives and levels at the beginning of the scene
Below PlayerHitBox in collision with end
Add Trigger once
You change the scene before you write.
The first action in screen 1 must be the last one.
I think you can’t store the Storage values in Global variables, you need a Scene variable to make a transition of data.
Read the storage value to some_scen_variable
Then assign to the Global variable the some_scene_variable value.
Tried Mixen’s and jack’s. Didn’t work
like this? didn’t work
(after i took this screen i changed the global variable below “levels exists in storage save” to scene variable and still not working)
You are right…
Change that global variable levels to scene variable levels
You should be changing that global variable to scene variable.
you are refering to what i wrote below the image? thanks
what about change the global variable add 1
did you changed that too?
Here an example of what I’m saying
You can see the Read from storage to a scene variable gs_key_0
Then assign the gs_key_0 to the Global variable g_mapped_keys
In your case must be like
Read “Lives” from storage “save” and store value in gs_lives
Change global variable Lives to gs_lives
Like this? didn’t work.
Also tried the global variables inside orange square as scene variables and also didn’t work
I think it should not be change the text of global variable levels(string)
instead it should be change the global variable(number)
Dude you’re setting the global variable Levels to a literal text “VariableString(Levels_sv)”
Remove the quotes just set to VariableString(Levels_sv)
removed. still doesn’t work, tried as text and as value string and no string
Do this start your game and go to View → Toggle Developer Tools click Storage->file://
Then look for your save Storage and check which values are stored there
Or take a screenshot and post it here so I can check the values.
Other thing is in your event if is a resume button I think there is no need to check if “levels” exists in storage “save” because there is for sure that value exists.
The logic on setting up storage is:
In your main scene or any added external event.
First check if exist if not then create.
Look what I do is this.
I have MainMenuScene
MainGlobals is an external event that is first called in MainMenu so if all Storage values and keys are checked there.
This is MainGlobals
This is my MainMenu
As you can see all the Storage is controlled there.
Later for instance in my GameScene if I need to Read some value form Storage I do this way.