Discuss Scratch

CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

How do you make a cloud data save game script?
I think it uses lists, cloud data, joining, and usernames

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
ChocolateTeapotNot
New to Scratch
100+ posts

Saving script (cloud data) WITHOUT a code

Cloud variables can only store numbers so you have to encode your data to be saved into a large numeric string.

My drmcw account has viewed too many forum topics so cannot view anymore! This account however says it all!
CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

Okay,but what about Griffpatch's cloud multiplayer game?
You don't have to put in a codetoload progress; just go in with your username.

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
1234abcdcba4321
Scratcher
1000+ posts

Saving script (cloud data) WITHOUT a code

define encode [String]
set [chars v] to [1234567890abcdefghijklmnopqrstuvwxyz_] // +whatever else you want
set [output v] to []
set [i v] to [0]
repeat (length of (String))
change [i v] by (1)
set [i2 v] to [0]
repeat until <(letter (i) of (String)) = (letter (i2) of (chars))>
change [i2 v] by (1)
end
if <(i2) > [9]> then
set [output v] to (join (output) (join [0] (i2)))
else
set [output v] to (join (output) (i2))
end
end
define decode (Number)
set [chars v] to [1234567890abcdefghijklmnopqrstuvwxyz_] // Make sure it's the exact same as encode
set [output v] to []
set [i v] to [1]
repeat ((length of (Number)) / (2))
set [i2 v] to [0]
repeat until <(join (letter (i) of (Number)) (letter ((i) + (1)) of (Number))) = (i2)>
change [i2 v] by (1)
if <(i2) < [10]> then
set [i2 v] to (join [0] (i2))
end
end
set [output v] to (join (output) (letter (i2) of (chars)))
change [i v] by (2)
define split [string] with separator [separator]
set [i v] to [0]
delete (all v) of [output v]
add [] to [output v]
repeat (length of (string))
change [i v] by (1)
if <(letter (i) of (string)) = (separator)> then
add [] to [output v]
else
replace item (last v) of [output v] with (join (item (last v) of [output v]) (letter (i) of (string)))
end
end
define Load Cloud List
decode (cloud list) // category=custom
split (output) with separator [/] // category=custom
define Add [string] to Cloud List
Load Cloud List // category=custom
encode (join [/] (string)) // category=custom
set [cloud list v] to (join (cloud list) (output)) // cloud list is a cloud variable, BTW
Output is supposed to be orange, not red. In all of those above.
define Load save data
Load Cloud List // category=custom
set [i v] to [1]
repeat until <<(item (i) of [cloud list v]) = (username)> or <(i) > (length of [cloud list v]>>
change [i v] by (2)
end
if <(i) > (length of [cloud list v])> then
... // restart from point blank
else
set [user ID v] to ((i) + (1))
set [my save data v] to (item (user ID) of [cloud list v]
interpret code // category=custom
Basically, from here, you would do the same thing as a script in an answer box you would enter.
Huh? You want to be able to add data to that list, too?
define update to my version of list
replace all [ ] s in (output) with [/] s :: custom // this one's the only one that should be this color; the rest should be orange
encode (output ::variables) // category=custom
set [cloud list v] to (output ::variables)

define save [data] // it should be run without screen refresh, to prevent corruption
Load Cloud List // category=custom
replace item (user ID) of [output v] with (data)
update to my version of list // category=custom
interpret code // category=custom
I forgot to define this earlier, so…
define replace all (stringa) s in (stringb) to (stringc) s
set [i v] to [0]
set [output v] to []
repeat (length of (stringb))
change [i v] by (1)
if <(letter (i) of (stringb)) = (stringa)> then
set [output v] to (join (output ::variables) (stringc))
else
set [output v] to (join (output ::variables) (letter (i) of (stringb)))
end

Last edited by 1234abcdcba4321 (April 13, 2014 17:58:30)


I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

cool lemme try this

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
1234abcdcba4321
Scratcher
1000+ posts

Saving script (cloud data) WITHOUT a code

Also, more things:
For the “restart from point blank”:
add (username) to [output v]
add [default data] to [output v]
update to my version of list // category=custom
interpret code // category=custom
It's complicated either way.

Last edited by 1234abcdcba4321 (Feb. 2, 2014 18:32:14)


I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
bainer101
Scratcher
35 posts

Saving script (cloud data) WITHOUT a code

How Do You Use It Like Open What You Saved?
1234abcdcba4321
Scratcher
1000+ posts

Saving script (cloud data) WITHOUT a code

See the other scripting…

I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

Hey 1234, could YOU script it and send me the link to it?
I can't really comprehend it; looks like blocks, then lists, then variables.

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
1234abcdcba4321
Scratcher
1000+ posts

Saving script (cloud data) WITHOUT a code

I'll do that later, it's understandable enough.

I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

Thx, plz do it soon

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
resh123
Scratcher
9 posts

Saving script (cloud data) WITHOUT a code

I made a system similar to this but it didn't seem as good as this. Instead of a string splitter to add only some text, I did this.
It was just as efficient. I had the whole list stored on a variable in decoding. It had too decode the variable into a list with ; to separate it.
define find (s1) , (s2) of [string]
set [i v] to (s1)
set [result v] to []
repeat ((s2) - ((s1) - (1))
set [result v] to (join (result) (letter (i) of (string)))
change [i v] by (1)
end
define decode listdata to playerdata
delete (all v) of [playerdata v]
set [i v] to [0]
set [i2 v] to [1]
repeat (length of (listdata))
change [i v] by (1)
if <(letter (i) of (listdata)) = [;]> then
find (i2) , ((i) - (1)) of (listdata)
add (result) to [playerdata v]
set [i2 v] to ((i) + (1))
end

Last edited by resh123 (Feb. 6, 2014 01:09:45)


CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

ok i will try it

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
bainer101
Scratcher
35 posts

Saving script (cloud data) WITHOUT a code

1234abcdcba4321 wrote:

See the other scripting…
What Other Scripting?
1234abcdcba4321
Scratcher
1000+ posts

Saving script (cloud data) WITHOUT a code

bainer101 wrote:

1234abcdcba4321 wrote:

See the other scripting…
What Other Scripting?
All the scripting in those two posts work.

I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

….wow

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
Cirrusdrake
Scratcher
3 posts

Saving script (cloud data) WITHOUT a code

does anyone know how to make a saving script, except its username specific–for instance, let's say a guy named wolf123 comes along and plays this game that has saving script cloud data. He presses a “save” button and leaves. Next time wolf123 comes, he just openes the game and he is autimatically to the spot where he pressed “save”. Anyone know how to do that?
blartex
Scratcher
6 posts

Saving script (cloud data) WITHOUT a code

My cloud data won't save!!!!!!!!!!!
CraZGuy
Scratcher
77 posts

Saving script (cloud data) WITHOUT a code

idk man that's what IM askin

@CraZGuy 0|^_^|o

Years of Scratch, and I am still astounded by its community.
1234abcdcba4321
Scratcher
1000+ posts

Saving script (cloud data) WITHOUT a code

Well, then find the error. It's likely you're not using it correctly, or show me the project you have.

I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.

Powered by DjangoBB