Hi, it seems you are using two different storages.
First you save your variable in “CheckPoint” of storage “level” but then you load “level” from storage “Storage”. Shouldn’t it be: Load “CheckPoint” from storage “level” and store value in CheckPoint?
Btw your sound name says “ChekPoint”. Is this possibly a typo?
the problem is while copying it i couldn’t find the Read And Write actions maybe because its an old version of GDevelop and i have the new one so im now a bit confused about if the save=Read
and the Load=Write
no still i tried using this method Julas medo method but still i didnt work it just confused me more tbh if u have any idea
im open to any kind of advice cuz my head is spinning right now LOL.
I wonder if you have to have an action to delete the old checkpoint position from storage and then save the new position. I think I remember that was something I had to do.
I’ll take another look at my stuff this week and see what I can share.
You are aware saving to storage and loading from it makes only sense when you are closing and opining later your game?
Because i fail to understand why you would need saving to storage otherwise?
When it is just checkpoint
So lets for now ignore storage
And all you need to start from last checkpoint when game is still running and you hit restart button is
Condition
Player is in collision with checkpoint
Action
Change Global Variable XPos set to Player.X()
Change Global Variable YPos set to Player.Y()
Now when you hit restart
Condition
Cursor is on Restart button
LMB is pressed
Trigger Once
Action
Start game however you start it or whatever
Change player X Position set to GlobalVariable(XPos)
Change player Y Position set to GlobalVariable(YPos)
And now after hitting restart you are at the position of last checkpoint
If that is not enough for you just reply and we will proceed with saving to storage
Just to add some context to what Jules-Mado-Games wrote, when you preview the game it can be useful to clear the storage Storage - GDevelop documentation
If your actual goal is to have your player position for starting the level again at some point within a play session but not keeping the information when you quit the game then ZeroX4’s approach is the way to go. I assumed you want to keep the progress also after closing the game.
i tried it but when the player Died it gives me the “You Died” Screen but when clicking the button it just dont let me go back to the last checkpoint :
Change player X position set to GlobalVariable(CheckX)
Change player Y position set to GlobalVariable(CheckY)
I told you already there is no point in making separate scene for shop
Now you are making separate scene for death screen
And you are only constantly creating problems for yourself just because you are using scene switching when you do not need to
It is like you are driving your car to McDonalds
And MDonalds happens to be 1 min away from your home IF YOU CRAWL
This is what you are doing
Instead of changing scene you could simply put whatever you have in You Died scene into some layer on Main Scene scene
And hide that layer while showing it only when well player died
Now you removed problem of position not loading because something not existing and crap like that
Really stop complicating stuff for yourself because you gonna have very bad experience with game developing
If you gonna try to do something just because you can and not try to make it as simple as possible you gonna develop this game for years and on each step you gonna come here for help doing even most simple tasks
But how you gonna proceed from now on is your choice
because its sets the player’s health always to 0
i tried your method but the problem that i faced is when teleporting from place to place the it shows the first background like this
You are currently on You Died scene and you click that button
What you are doing IN ORDER is
Change position of player to Check variables
And then switch to Main Scene
So let’s stop here for a moment and answer few questions
Does your player exist on You Died scene that you are changing its position?
Does changing scene AFTER you 1st change position of something that does not exist yet should change it position when you get to other scene?
You are complicating stuff for yourself for no reason you add scenes for no reason you are expecting something to happen just because you expect it and not because logic of events would lead to it
I am not making fun of you i am just trying to teach you to pay attention to what you are doing
I gonna stop helping you now and let other ppl try because i think you get even more confused from multiple options you are offered by us
I will come back to helping you when nothing else for you will work
Simply removing that scene changing and using layer to show or hide death screen would solve your whole problem
i know and you’re a great teacher tbh for the other scenes im not gonna use it i tried using this events from this video right here save/load and the problem that i faced how to implement the same mechanic for the health system as he used in the beginning of the video that what im trying to figure out right now
i want when the player’s health goes below 5 or 0 to die and give me the option to re spawn
a save and load option(checkpoint) so when the player died he returns back to his last checkpoint
a save point that when the player is in collision with it it saves his health and the other stuff and when come back again he starts from the checkpoint
and im sorry if im being a bit annoying
If you figure it out
I will sound like broken record but you are creating problems for yourself for no reason
If you are able to save all these variables as children
Then why you try to save 2 different variables as something separate where you could just put them as children of Saving variable and only save/load Saving variable?
On top of that for each save you should have separate name for group and for storage but that is something you most likely did not know