mit scratch - I’m trying to make a SaveLoad feature in my game but it only saves locally - Stack Overflow

I’m trying to make a SaveLoad system, and it works locally. For example, if you play, then you save, i

I’m trying to make a Save/Load system, and it works locally. For example, if you play, then you save, it saves. You can then press load and if you enter the save code, it will load. The problem is if you close the tab and open scratch in a new tab, the Code is now gone from the list along with the password. I want to know if there’s a way to make it so that you can even get on a different device to play and if you enter the password and save code, it will load your progress.

These are the code of my save and of my load buttons. I haven’t tried cloud variables, but I don’t think that would really help and I’m not sure about anything else

I’m trying to make a Save/Load system, and it works locally. For example, if you play, then you save, it saves. You can then press load and if you enter the save code, it will load. The problem is if you close the tab and open scratch in a new tab, the Code is now gone from the list along with the password. I want to know if there’s a way to make it so that you can even get on a different device to play and if you enter the password and save code, it will load your progress.

These are the code of my save and of my load buttons. I haven’t tried cloud variables, but I don’t think that would really help and I’m not sure about anything else

Share Improve this question edited Feb 21 at 4:25 ggorlen 58k8 gold badges114 silver badges157 bronze badges asked Feb 21 at 2:29 Leo CoxLeo Cox 31 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 1

Please be aware that Scratch does not save the contents of lists 'Codes' and 'Passwords' while/after playing. There is one exception: when the owner of the project (you) is inside the project editor ('look inside') while/after playing, and then saves the project (or the autosave kicks in), then list contents are saved inside the project, making them available to subsequent sessions.

In all other cases (project is not saved and/or player is not the owner), the list contents are not saved. New save codes will be lost, causing later attempts to load the game to fail.

You should probably reconsider your approach. The whole point of save codes is that you let the player save the code, not the program. If you want to prevent players to cheat by crafting their own save code, add a checksum.

Examples can be found in the Scratch wiki, in various Scratch projects, in the Scratch forums and on YouTube.

You would have to import cloud variables, but you have to use them carefully as only 4 total cloud variables may be used

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745170201a4614878.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信