This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-07-11 13:53:57

dearkids
Scratcher
Registered: 2008-01-15
Posts: 97

If someone already posted this, sorry! (SAVE SCRIPT)

MASSIVE. BREAKTHROUGH. OK, this script takes a while to replicate, but it allows a ACTUAL SAVE SCRIPT. The forum blocks don't have the neccesary parts, but I'll tell you how to make a save script.

OK, first of all, for an RPG, it's like this:

You have these variables: EXP, LVL and Coins. Make a list called "Save Code". Hide it. Now, make a sprite. Don't worry what it looks like. Just make it do this:

when "Sprite1" clicked
ask "Hmm? What do you need?" and wait
Now, I'm too lazy to type this part, but you need to connect:

if letter 1 of answer = s and letter 2 of answer = a and letter 3 of answer = v and letter 4 of answer =e
broadcast "Save Code"
say "OK, I'm calculating your code..." for 5 seconds

Now, stop the work on this sprite for a bit and save the project.

Click on the Stage and create this script:

when I recieve "Save Code"
if Coins>99
insert "a" into "Save Code"
else
if Coins>199
insert "b" into "Save Code"
if EXP>99
insert "d" into "Save Code"
else
if EXP>199
insert "g" into "Save Code"
if LVL>4
insert "r" into "Save Code"
else
if LVL>9
insert "y" into "Save Code"

That's a simplified version. Save the project again.

Now, go back to the sprite we worked on earlier. Time for the load code. First of all, check what's in the "Save Code" list. It may have inserted all of the above letters, so this may need some fixing.

Now, just add this simple script below the "OK, I'm calculating your code..." speech script.

say [join (Heres your code: (Save Code)]

I'll update this later.


Final Fantasy VII's best characters are Cloud, Nanaki, and Cid. Don't deny it.

Offline

 

#2 2009-07-11 14:04:13

Jacobo
Scratcher
Registered: 2007-06-15
Posts: 100+

Re: If someone already posted this, sorry! (SAVE SCRIPT)

makes sense


"It's like deja vu all over again"
-Yogi Berra

Offline

 

#3 2009-07-11 14:07:45

FantasyTales
Scratcher
Registered: 2008-06-02
Posts: 1000+

Re: If someone already posted this, sorry! (SAVE SCRIPT)

the easier way is to just to make none of the variables reset themselves, that way when somebody saves the project they keep all of their levels.


http://ageofthefuture.ismywebsite.com/images/dg_sig_2_small.png
http://images.myadoptables.com/adopted/2340.pnghttp://images.myadoptables.com/adopted/2339.png

Offline

 

#4 2009-07-11 17:00:16

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: If someone already posted this, sorry! (SAVE SCRIPT)

I hate using lame workarounds like this just for scratch. Cookies would be a nice solution to this problem.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2009-10-02 17:13:14

dearkids
Scratcher
Registered: 2008-01-15
Posts: 97

Re: If someone already posted this, sorry! (SAVE SCRIPT)

archmage wrote:

I hate using lame workarounds like this just for scratch. Cookies would be a nice solution to this problem.

... Sheesh, Archy, don't have to be so angry. I was just happy about me actually having a good idea.


Final Fantasy VII's best characters are Cloud, Nanaki, and Cid. Don't deny it.

Offline

 

#6 2009-10-02 17:49:54

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: If someone already posted this, sorry! (SAVE SCRIPT)

He's just saying that scratch could use cookies as a solution to the save problem. He's not mad at you.


I'm graduating HS this April and going to college in the Fall.

Offline

 

#7 2009-10-02 17:56:54

dearkids
Scratcher
Registered: 2008-01-15
Posts: 97

Re: If someone already posted this, sorry! (SAVE SCRIPT)

steppenwulf wrote:

He's just saying that scratch could use cookies as a solution to the save problem. He's not mad at you.

Oh.


Final Fantasy VII's best characters are Cloud, Nanaki, and Cid. Don't deny it.

Offline

 

Board footer