Discuss Scratch

DylanSearch
Scratcher
50 posts

A LocalStorage Variable type

This is a cool idea that could be used to save progress in games. A variable that saves data in itself so that when that same user visits the project again, the variable is still how it was. It could use the LocalStorage feature in Javascript. Other users will not see the same data (Which makes this different to Cloud Variables). Does anyone support the idea?

Last edited by DylanSearch (Jan. 7, 2019 23:59:00)

IlyaMiheevilia
Scratcher
4 posts

A LocalStorage Variable type

I am support this idea.
DANISON
Scratcher
100+ posts

A LocalStorage Variable type

Support! They should also add a way for the player to reset them if he wants to.
epicRedHot
Scratcher
500+ posts

A LocalStorage Variable type

Support, they could be saved as cookies to the user's computer as something like: “project number|variable name|variable value”.
Edit: Maybe you could add this to the original post, so that there won't be any confusion on how it would be implemented?

Last edited by epicRedHot (Jan. 7, 2019 18:09:53)

bybb
Scratcher
1000+ posts

A LocalStorage Variable type

epicRedHot wrote:

Support, they could be saved as cookies to the user's computer as something like: “project number|variable name|variable value”.
Edit: Maybe you could add this to the original post, so that there won't be any confusion on how it would be implemented?
No, LocalStorage. It's a better way to store this data within the browser.

Edit: My reasoning
Setting a cookie would be a bad way to do this, since cookies aren't really built to store save data for many projects, but localStorage gives you at least 5MB, so this could give 1kb of Storage to 5000 projects which is plenty. Cookies however, are much more limited and vary wildly by browser.

Last edited by bybb (Jan. 7, 2019 20:04:14)

hunter601
Scratcher
27 posts

A LocalStorage Variable type

I SUPPORT THE IDEA

Good stuff means good inspiration
DylanSearch
Scratcher
50 posts

A LocalStorage Variable type

bybb wrote:

epicRedHot wrote:

Support, they could be saved as cookies to the user's computer as something like: “project number|variable name|variable value”.
Edit: Maybe you could add this to the original post, so that there won't be any confusion on how it would be implemented?
No, LocalStorage. It's a better way to store this data within the browser.

Edit: My reasoning
Setting a cookie would be a bad way to do this, since cookies aren't really built to store save data for many projects, but localStorage gives you at least 5MB, so this could give 1kb of Storage to 5000 projects which is plenty. Cookies however, are much more limited and vary wildly by browser.
That is what I was thinking of.
BFDISuperFan
Scratcher
100+ posts

A LocalStorage Variable type

If this gets added, then I could definitely make something like a account based login screen on a game that actually works, it sounds cool.
I definitely support this.
CalculatorFun
Scratcher
94 posts

A LocalStorage Variable type

Support.
There shouldn't be much of a debate whether to or not to add a locally stored variable, there's no way to add chat rooms as it's local.

There are many ways to store a local variable I think the OP's method would work the best in my opinion. (LocalStorage from JS)

☁️ A cloud variable would have the cloud emoji indicating that it's stored on the cloud
(Emoji breaks post idk) Floppy disk emoji if it's locally stored.
Half of the message deleted itself but adding this would allow for more extensive projects to be played till the end by a viewer.

Last edited by CalculatorFun (Jan. 8, 2019 06:13:29)

DylanSearch
Scratcher
50 posts

A LocalStorage Variable type

DANISON wrote:

Support! They should also add a way for the player to reset them if he wants to.
But wouldn't you just be able to do:
set [Variable v] to []
CalculatorFun
Scratcher
94 posts

A LocalStorage Variable type

DylanSearch wrote:

DANISON wrote:

Support! They should also add a way for the player to reset them if he wants to.
But wouldn't you just be able to do:
set [Variable v] to []
He might mean manually reset and clear specific data, not the project resetting them.
DylanSearch
Scratcher
50 posts

A LocalStorage Variable type

Bump.
14152cool
Scratcher
100+ posts

A LocalStorage Variable type

DylanSearch wrote:

Bump.
Luvexina
Scratcher
500+ posts

A LocalStorage Variable type

Support! Some games are really long and have complicated save codes.
PixelYoshi
Scratcher
100+ posts

A LocalStorage Variable type

I REALLY support this!
miniepicness
Scratcher
1000+ posts

A LocalStorage Variable type

This is way better than making tons of cloud variables as a workaround. Support

Last edited by miniepicness (April 24, 2019 00:39:38)

-Accio-
Scratcher
1000+ posts

A LocalStorage Variable type

CalculatorFun
Scratcher
94 posts

A LocalStorage Variable type

-Accio- wrote:

Duplicate
I don't know if this would exactly qualify as a duplicate, the linked topic talks about a variable stored on the server, because it describes using it on 2 seperate computers- but this one is for variables (string) kept in js LocalStorage (Not in the server, but the browser, meaning you can't just switch computers)

Edit:
user variables = on server, only edited by user
LocalStorage variables = browser, only edited by user, already in js

Last edited by CalculatorFun (April 24, 2019 01:35:31)

-Accio-
Scratcher
1000+ posts

A LocalStorage Variable type

CalculatorFun wrote:

-Accio- wrote:

Duplicate
I don't know if this would exactly qualify as a duplicate, the linked topic talks about a variable stored on the server, because it describes using it on 2 seperate computers, but this one is for variables kept in js LocalStorage (Not in the server, but the browser, meaning you can't just switch computers)
Yes, but it's the same general idea.
miniepicness
Scratcher
1000+ posts

A LocalStorage Variable type

-Accio- wrote:

CalculatorFun wrote:

-Accio- wrote:

Duplicate
I don't know if this would exactly qualify as a duplicate, the linked topic talks about a variable stored on the server, because it describes using it on 2 seperate computers, but this one is for variables kept in js LocalStorage (Not in the server, but the browser, meaning you can't just switch computers)
Yes, but it's the same general idea.
Same result isn’t same idea. Not really a duplicate. Don’t close this.

Last edited by miniepicness (April 24, 2019 03:01:03)

Powered by DjangoBB