admin管理员组文章数量:1415491
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 badge2 Answers
Reset to default 1Please 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
本文标签: mit scratchI’m trying to make a SaveLoad feature in my game but it only saves locallyStack Overflow
版权声明:本文标题:mit scratch - I’m trying to make a SaveLoad feature in my game but it only saves locally - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745170200a2645927.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论