Discuss Scratch

VedanshS933
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

minekraftkid wrote:

I'm not sure if this is still relevant, but I 100% support. It's been beautifully implemented in turbowarp, and I'd love to see it as part of the native scratch experience.

This is relevant
mumu245
Scratcher
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.
Minecraft_Master3964
Scratcher
500+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

mumu245 wrote:

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.
Yeah, I think Local Storage would be more efficient than cookies
TeenySpoon
Scratcher
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.
superbuddy2
Scratcher
100+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.
54387a
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

Edit: Ninja'd

Last edited by 54387a (Aug. 16, 2023 18:45:16)

superbuddy2
Scratcher
100+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

superbuddy2 wrote:

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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)
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.

Last edited by 54387a (Aug. 16, 2023 23:11:49)

RobotChickens
Scratcher
500+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

bump
josueart
Scratcher
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

Last edited by josueart (Aug. 26, 2023 20:58:39)

scratchcode1_2_3
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

josueart wrote:

(#434)
~5 MB
MiB, not 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
dogfish517
Scratcher
86 posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

bump
superbuddy2
Scratcher
100+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

54387a wrote:

(#432)

superbuddy2 wrote:

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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)
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.

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
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

superbuddy2 wrote:

54387a wrote:

(#432)

superbuddy2 wrote:

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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)
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.

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.
That's a totally different suggestion that doesn't make sense and isn't implemented.
superbuddy2
Scratcher
100+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

54387a wrote:

(#438)

superbuddy2 wrote:

54387a wrote:

(#432)

superbuddy2 wrote:

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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)
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.

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.
That's a totally different suggestion that doesn't make sense and isn't implemented.

No, that's how list saving works.
__Falcon-Games__
Scratcher
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.

OP wrote:

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
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

mumu245 wrote:

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.
ye thats what snap uses for the database library as well
54387a
Scratcher
1000+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

superbuddy2 wrote:

54387a wrote:

(#438)

superbuddy2 wrote:

54387a wrote:

(#432)

superbuddy2 wrote:

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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)
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.

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.
That's a totally different suggestion that doesn't make sense and isn't implemented.

No, that's how list saving works.
Foolproof list saving doesn't exist currently.

Last edited by 54387a (Sept. 23, 2023 14:42:30)

superbuddy2
Scratcher
100+ posts

Cached Variables!! [Saved Games!] / Locally Saved Variables

54387a wrote:

superbuddy2 wrote:

54387a wrote:

(#438)

superbuddy2 wrote:

54387a wrote:

(#432)

superbuddy2 wrote:

54387a wrote:

(#433)

superbuddy2 wrote:

Zro716 wrote:

(#3)

Superdoggy wrote:

As long as you do it right, cloud variables are a very effective method of saved games.
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.

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.
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.

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)
But you would need this suggestion implemented for that to work because a reload would immediately clear this without this suggestion implemented.

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.
That's a totally different suggestion that doesn't make sense and isn't implemented.

No, that's how list saving works.
Foolproof list saving doesn't exist currently.
Look at the script above.

Powered by DjangoBB