Hi, I have a problem with save and load it didn’t work in my game, I want to save player position, so I have load button in the mainmenu and the save button in the pausedmenu, and this is my screen shoot for the events…
Check if there anything written in storage (use ctrl + shift + i, select the Application tab and click on Local storage > file://) You should see the saved values and storage area.
If there is, check that you are reading and writing a value and not a text (double click on the read and write actions to confirm this)
Make sure the variables you are reading into are scene variables. Globals won’t work
You haven’t answered my questions - the screen shots don’t show how you use the variables (PriestX and PriestY) nor do they show where are you setting the position of Priest using the variables.
You show the events reading the values and setting 2 variables with them, but nowhere can I see that the Priest’s position has been changed using those 2 variables.
The other 3 questions to answer are :
Keep in mind these questions weren’t just asked for the sake of it. It’s to work out where the problem might be. There are a few possible reasons, and we want to eliminate as many of them until we work out where the problem lies.
Hi, thank you for continue helping, as for the first question i checked the save value through ctrl + shift + i
when i press save the x and y values change…
but when I press load nothing happen, is there a way to inspect the read values through debugger or I must see it in the same way I see the save value?
and for the second question i didnt understand exactly what do you mean do you mean the scene variable PriestX=0 and PriestY=0 in the variable list?
What I mean is how do you know the variables PriestX and PriestY have values. You can determine this a number of ways :
place a temporary text box on the screen and output the variable values to that.
run debug mode, and inspect the variables
in the event that reads to values in add the action to write it to console. Then run in debug and check the value that’s written out to the console area.
The other thing to do is make sure the read action is executed. In the event where the values are read in, add a temporary event to change the colour (tint) of one of the on-screen objects (say the red-heads to “0;0;255”) . If it changes colour, then you know the actions are being hit. If it doesn’t change colour, then the event conditions are not being met.
You can inspect the priest object and check it’s position, and ensure it’s the same as the saved values after you clicked load.
BTW, are you doing anything else whe the load button has been pressed? You’re not reloading the scene by any chance?