Saving and Loading help

I am trying to make it so that the player can save in certain spots(but at the moment, you can save anywhere by pressing s, and try to load it by pressing w(if it is working)), this will save the scene you are currently in(IDK if this even works) where it detects the labeled scene(the labeled scene is changed to the scene they are about to switch to before the scene switch), the position of the save item(currently the player location, until I get the save object and add it), the items you have, etc.

when you load the save, you will get back to full HP, sent back to the last place where you saved(both scene and position), and any items that you collected after the last time you saved will be lost and reset, etc.

can I have help finding out how to do the save and load system?

link to script: PlayCanvas | HTML5 Game Engine

Hi @Linkplayer!

I’m afraid this is not easy to achieve, but maybe the topics below can help you a bit.

I think I figured it out, but now I can’t find out how to detect if we are loading, the error message says “No String”, is this based on script loading order, if it is, I will make the item script save the collected items, the scene script for the scene save, but make the x and y position that is saved part of the save script, since the player will spawn on the save object. I may have to make isLoading a global variable again when I start to load the player location after the scene switch.

1 Like