Discuss Scratch

CrazyCoder1247
Scratcher
100+ posts

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

I am bringing this up because many people want this, including me

king

Last edited by CrazyCoder1247 (Oct. 22, 2025 11:22:48)

tagrim123
Scratcher
500+ posts

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

Bump!
climbing_god777
New Scratcher
1 post

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

This is a good idea, in some games There are saves that are frustrating to use but they work. This would be a better way to save variables.
CrazyCoder1247
Scratcher
100+ posts

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

climbing_god777 wrote:

This is a good idea, in some games There are saves that are frustrating to use but they work. This would be a better way to save variables.
I am very proud of you that this is ur first forum post.
dizzyboy42
Scratcher
500+ posts

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

this would be super helpful!
Turbo_yeeter
Scratcher
100+ posts

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

Support!
kluuko
Scratcher
20 posts

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

how to make a signature?

Edit: found it. link under the page of discusions.

Last edited by kluuko (Nov. 10, 2025 09:56:30)

lionheart921
Scratcher
100+ posts

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

Bump. I have used this in Snap! before to both save a high score and the current game state (in 2048). This would be helpful for making longer games, because you don't have to play it all in one session, you could just save the game state and continue from there. They're also simple to use for making a highscore, just do a normal highscore script but the variable is a local variable.

Last edited by lionheart921 (Nov. 11, 2025 15:43:59)

dizzyboy42
Scratcher
500+ posts

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

dizzyboy42 wrote:

this would be super helpful!
here's my reason, I have been working in a game where your score saves, but automatically if we had this, then I would be able to make it SO much quicker
Zoetheames
Scratcher
42 posts

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

wait, this post is still active? thats crazy man
kluuko
Scratcher
20 posts

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

jmdzti_0-0
Scratcher
1000+ posts

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

Zoetheames wrote:

wait, this post is still active? thats crazy man
it’s still relevant since it hasn’t been added yet.

the only current way to do this is via the translate reporter, and it’s quite tedious to pull off.
CrazyCoder1247
Scratcher
100+ posts

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

jmdzti_0-0 wrote:

Zoetheames wrote:

wait, this post is still active? thats crazy man
it’s still relevant since it hasn’t been added yet.

the only current way to do this is via the translate reporter, and it’s quite tedious to pull off.
wait, WHAT? this is possible via the translate reporter?!?!? how???
mtaka4
Scratcher
500+ posts

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

CrazyCoder1247 wrote:

jmdzti_0-0 wrote:

Zoetheames wrote:

wait, this post is still active? thats crazy man
it’s still relevant since it hasn’t been added yet.

the only current way to do this is via the translate reporter, and it’s quite tedious to pull off.
wait, WHAT? this is possible via the translate reporter?!?!? how???
I don't know how to code it, but I do know how it works.
So basically, when you translate something, it saves to your cache temporarily, so in other words, you store the translation.
After that, the project somehow knows what you translated, so ta-da.
kluuko
Scratcher
20 posts

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

mtaka4 wrote:

CrazyCoder1247 wrote:

jmdzti_0-0 wrote:

Zoetheames wrote:

wait, this post is still active? thats crazy man
it’s still relevant since it hasn’t been added yet.

the only current way to do this is via the translate reporter, and it’s quite tedious to pull off.
wait, WHAT? this is possible via the translate reporter?!?!? how???
I don't know how to code it, but I do know how it works.
So basically, when you translate something, it saves to your cache temporarily, so in other words, you store the translation.
After that, the project somehow knows what you translated, so ta-da.
How to code that???????????? That might be the best way to do that but how?
CrazyCoder1247
Scratcher
100+ posts

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

kluuko wrote:

mtaka4 wrote:

CrazyCoder1247 wrote:

snip
I don't know how to code it, but I do know how it works.
So basically, when you translate something, it saves to your cache temporarily, so in other words, you store the translation.
After that, the project somehow knows what you translated, so ta-da.
How to code that???????????? That might be the best way to do that but how?
yeah, if anyone know how to do this pls tell. also, even though this is technically possible rn, we still need a real implementation because not everyone is a rocket scientist
jmdzti_0-0
Scratcher
1000+ posts

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

mtaka4 wrote:

So basically, when you translate something, it saves to your cache temporarily, so in other words, you store the translation.
After that, the project somehow knows what you translated, so ta-da.
Not really. It works by measuring the time a translation takes. A good margin is 0.1 seconds.

Since the only way to know what was saved is by brute force, the “attempts” will also get cached and make the code loadable once. I am working on a fix for this so I will post it here when I have it.

The data can be loaded by a different project than the one which saved it, making interferences possible. It’s a good idea to include a random string in your translation request so this doesn’t happen.

It is also worth noting that translation cache doesn’t last very long and it can very easily be cleared by accident, so i’d make the cached variables use localStorage() instead (cookies are not a good idea since the users’ login info is stored on there).

Last edited by jmdzti_0-0 (Nov. 16, 2025 16:58:01)

leog20162
Scratcher
100+ posts

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

MrSherlockHolmes wrote:

epninja wrote:

This is something I'd be very interested in.

Variables that would cache into the user's browser, so setting the variables, and the value that the variables contain is both written and read from the cache, meaning that they retain the same value to the user as they last time they went on it. This would be useful for projects such as games, for personal highscores and even saved games, so that players could continue from where they left off.

Other uses could be ideas like saved images in drawing/art programs, saved passwords and accounts in OS projects. There would be quite a lot of useful uses for cached variables.

I do hope something like this is considered!
Well, when cloud lists are introduced, there'll be no need. However, it sounds like a good extension project
set [>>☁ v] to (10) for (username) :: variables
Cloud lists are rejected…
xame2
Scratcher
2 posts

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

if <(too complicated) = true> then
speak
say

Last edited by xame2 (Nov. 22, 2025 02:46:44)

CrazyCoder1247
Scratcher
100+ posts

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

xame2 wrote:

if <(too complicated) = true> then
speak
say
<(too complicated) = (it really isn't)>

Powered by DjangoBB