Discuss Scratch
- Discussion Forums
- » Suggestions
- » Cached Variables!! [Saved Games!] / Locally Saved Variables
- VedanshS933
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
beautifully implemented in turbowarp, and I'd love to see it as part of the native scratch experience.I'm not sure if this is still relevant, but I 100% support. It's been
This is relevant
- mumu245
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
IDK if this has been suggested, but localStorage could be used instead of cookies. 2560 digits (the cloud variable limit) is very little for a savegame.
Also, there should be an option to clear these local variables.
Also, there should be an option to clear these local variables.
- Minecraft_Master3964
-
500+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Yeah, I think Local Storage would be more efficient than cookies IDK if this has been suggested, but localStorage could be used instead of cookies. 2560 digits (the cloud variable limit) is very little for a savegame.
Also, there should be an option to clear these local variables.
- TeenySpoon
-
500+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Support, this would remove the hassle of a player getting a save code, storing it, and then remembering where she stored it.
Also would be useful for big games like the one I'm working on right now. A save code is possible, but I think locally storing it would be better.
Also would be useful for big games like the one I'm working on right now. A save code is possible, but I think locally storing it would be better.
- superbuddy2
-
100+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
- sowut123
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Yeah, but you can't do that on Scratch. You can't pay for anything on Scratch, and variables would be only accessible by the projects that saved them.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
- 54387a
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
Last edited by 54387a (Aug. 16, 2023 18:45:16)
- superbuddy2
-
100+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:
when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
- 54387a
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
Last edited by 54387a (Aug. 16, 2023 23:11:49)
- josueart
-
500+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Support.
Note: localStorage could be a better option than cookies, but normal browsers have a hard limit of ~5 MB of data per website, about 5242880 characters, so it may not be the ideal solution.
Edit: https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#web_storage
Note: localStorage could be a better option than cookies, but normal browsers have a hard limit of ~5 MB of data per website, about 5242880 characters, so it may not be the ideal solution.
Edit: https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#web_storage
Last edited by josueart (Aug. 26, 2023 20:58:39)
- scratchcode1_2_3
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
(#434)MiB, not MB*
~5 MB
MiB is slightly bigger, but i get your point, it's not really that much but it's not too small either. it's about the same size of the project.json limit
- superbuddy2
-
100+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
(#432)But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
It's local and account specific, so if you logged onto a different account on the same device, or logged into the same account on a different device, the data would not be there, but if you reloaded or exited and re-entered the webpage on the same device and you are logged into the same account, the data would remain.
- 54387a
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
That's a totally different suggestion that doesn't make sense and isn't implemented.(#432)But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
It's local and account specific, so if you logged onto a different account on the same device, or logged into the same account on a different device, the data would not be there, but if you reloaded or exited and re-entered the webpage on the same device and you are logged into the same account, the data would remain.
- superbuddy2
-
100+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
(#438)That's a totally different suggestion that doesn't make sense and isn't implemented.(#432)But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
It's local and account specific, so if you logged onto a different account on the same device, or logged into the same account on a different device, the data would not be there, but if you reloaded or exited and re-entered the webpage on the same device and you are logged into the same account, the data would remain.
No, that's how list saving works.
- __Falcon-Games__
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Well this could be very good with restrictions like they can only access their own data and don't sneak into other cookies or anything like that.
If we used local storage however a lot of the problems would be avoided.
Right now I am not that sure, leaning towards support, if someone could give me a TLDR with clarification and all the main points, I could make a better decision.
That could slow down the Scratch servers even more then now!
If we used local storage however a lot of the problems would be avoided.
Right now I am not that sure, leaning towards support, if someone could give me a TLDR with clarification and all the main points, I could make a better decision.
I have a better idea, rather than storing cached vars as cookies (which makes people complain about spam), “cached” vars should actually be stored with each Scratch user's account info on the Scratch server.
That could slow down the Scratch servers even more then now!
Last edited by __Falcon-Games__ (Sept. 23, 2023 09:02:16)
- cookieclickerer33
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
ye thats what snap uses for the database library as well IDK if this has been suggested, but localStorage could be used instead of cookies. 2560 digits (the cloud variable limit) is very little for a savegame.
Also, there should be an option to clear these local variables.
- 54387a
-
1000+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Foolproof list saving doesn't exist currently.(#438)That's a totally different suggestion that doesn't make sense and isn't implemented.(#432)But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
It's local and account specific, so if you logged onto a different account on the same device, or logged into the same account on a different device, the data would not be there, but if you reloaded or exited and re-entered the webpage on the same device and you are logged into the same account, the data would remain.
No, that's how list saving works.
Last edited by 54387a (Sept. 23, 2023 14:42:30)
- superbuddy2
-
100+ posts
Cached Variables!! [Saved Games!] / Locally Saved Variables
Look at the script above.Foolproof list saving doesn't exist currently.(#438)That's a totally different suggestion that doesn't make sense and isn't implemented.(#432)But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.(#433)But what if you want it automatically inside the project while also not requiring the user to input it in manually? Also, it's only for the project. By the way, lists don't save automatically.(#3)right, but with several users writing to the cloud at once, it can sometimes cause collisions and mishaps. like in my internetz game, I frequently get complaints about data not being saved correctly, and when I investigate it comes down to two or more users saving data at the same time. so a cloud list is not a foolproof option for per-player saved data. As long as you do it right, cloud variables are a very effective method of saved games.
cookie variables sound like a very good idea, but there needs to be some kind of restriction to prevent unlimited storage of data to a browser's cache.
Cookies could be used as spyware, like if a seller knew that you were interested in buying something, it'd up the price. If they knew you were playing this game, game devs might be able to increase the price of their game.
Lists already save data to the computer's hard drive, so you could use that instead.
Edit: Ninja'd
All you need is this:when flag clicked
forever
replace (1) of [list name v] with (variable name)
end
when flag clicked
set [variable name v] to (list name :: list)
It's local and account specific, so if you logged onto a different account on the same device, or logged into the same account on a different device, the data would not be there, but if you reloaded or exited and re-entered the webpage on the same device and you are logged into the same account, the data would remain.
No, that's how list saving works.
- Discussion Forums
- » Suggestions
-
» Cached Variables!! [Saved Games!] / Locally Saved Variables