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

#1 2007-04-11 17:25:08

Cholo71796
Scratcher
Registered: 2007-04-07
Posts: 9

Save Engine?

I'm adding some stuff to the game 'RPG,' and I would like to make a save engine. So far, the only way I can think of doing this is make a sprite, say 'Load' scripts are:
When 'Load' Clicked:
Broadcast: 'Load'
There would have to be a copy of every other:
When Start Clicked
script, started with:
When I receive 'Load.'
I think this would be very hard to input into the game at this point, and is only seemingly possible to be done from the start of creating the game. Anything would be helpful, maybe even posting a sample game using the engine. Maybe just of a dot running across the screen, and when the save key is clicked, and you move some more, when the load key is clicked, you go back to where you were when you pressed the save key. I just can't think straight today!

Offline

 

#2 2007-04-12 09:23:37

jay
Scratch Team
Registered: 2007-03-11
Posts: 59

Re: Save Engine?

Hi Cholo,

I think I might finally understand what you're trying to do. Here's an example of a sprite that can save and load it's position, direction, size, and costume. This should be enough to get your game engine working, though you might have to add some variables to keep track of whether the sprite has a sword or how much money the sprite has. This will be a very ambitious project to undertake. Best of luck.

Save/Load engine:
http://scratch.mit.edu/projects/jay/1381

Offline

 

#3 2010-04-20 20:19:24

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

Re: Save Engine?

Bump you too!

A good Idea is to make a number code that contains all the data. then, have them enter it in to get to a certain spot.


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#4 2010-04-22 16:25:04

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Save Engine?

What you could do is have your own compiler.
So what you do you store all the varibles and data in a single variable separated by a '/'

join | 'Complied' | + | join | '/'| + |'other variable'| |

You repeat that code as many times as needed.

At the end put:
join | 'Compiled' | + '/'

Then you make a script like

set i to 0
set n to 0
delete all of save list
repeat |length of 'Compiled' + 1 | {{

change i by 1
if | not | letter i of 'Compiled' = '/' ||
{

set variable n to |join n and |letter i of 'Compiled'||

}

if | letter i of 'Compiled' = '/' |
add 'n' to save list
set n to '(nothing)'


}}



This would change a save data into a list.



save list = list
i  = variable
n  = variable
compile = variable


You can now reach me on Twitter @johnnydean1_

Offline

 

#5 2012-03-07 12:18:59

MightyMat
New Scratcher
Registered: 2012-02-10
Posts: 8

Re: Save Engine?

Don't know if this helps, but this is one I use for a high score table that saves...

[scratchblocks]
when I recieve [game-over v]
if <(score) > (high-score)>
set [high-score] to (score)
end

There is two variables I made to use this, score and high score.

Offline

 

#6 2012-03-07 12:31:01

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Save Engine?

MightyMat wrote:

Don't know if this helps, but this is one I use for a high score table that saves...

when I recieve [game-over v]
if <(score) > (high-score)>
set [high-score] to (score)
end
There is two variables I made to use this, score and high score.

don't forget to close the scratchblocks

Code:

 
[scratchblocks]
code here
[/scratchblocks]

SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#7 2012-03-07 12:38:29

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Save Engine?

Also, preferably don't bump 5 year old posts.


http://i.imgur.com/zeIZW.png

Offline

 

#8 2012-03-07 14:04:11

MightyMat
New Scratcher
Registered: 2012-02-10
Posts: 8

Re: Save Engine?

MightyMat wrote:

Don't know if this helps, but this is one I use for a high score table that saves...

[scratchblocks]
when I recieve [game-over v]
if <(score) > (high-score)>
set [high-score] to (score)
end

There is two variables I made to use this, score and high score.

I dont think that worked... It was supposed to show the script...

Offline

 

#9 2012-03-07 14:07:15

MightyMat
New Scratcher
Registered: 2012-02-10
Posts: 8

Re: Save Engine?

muppetds wrote:

MightyMat wrote:

Don't know if this helps, but this is one I use for a high score table that saves...

when I recieve [game-over v]
if <(score) > (high-score)>
set [high-score] to (score)
end
There is two variables I made to use this, score and high score.

don't forget to close the scratchblocks

Code:

 
[scratchblocks]
code here
[/scratchblocks]

Thanks

Here is the code I was supposed to do...

when I recieve [game-over v]
if <(score) > (high-score)>
set [high-score] to (score)
end
Woops, just noticed after typing it up that you'd typed it...

Offline

 

#10 2012-03-09 00:07:08

JDProducers
Scratcher
Registered: 2011-12-17
Posts: 40

Re: Save Engine?

Hi, I'm JDProducers, check out my projects here-
smile  http://www.scratch.mit.edu/users/JDProducers  smile

(Copy and paste in url [adress bar in other words])

I can help you make that save option (if that's what you mean).
-First you will make a variable labled "save" or "load" or something.
-Next you will apply this for all scripts that say - when green flag clicked - and put "only if variable does not equal 1" ( Hint - only do this for scripts that do not interrupt the logo or beginning.)
-Then in one of the sprites put - when green flag clicked - set "save" to 1. That way the first time they play it, it starts from the beginning and after the second time they will pick up where they left off.
-Finally put a new game sprite and use a script saying that every time it is clicked set "save" to 0.

-You're Welcome  big_smile


[img]C:\Documents and Settings\Administrator\My Documents\JDProducers Logo.BMP[/img]

Offline

 

#11 2012-03-09 00:22:21

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Save Engine?

JDProducers wrote:

Hi, I'm JDProducers, check out my projects here-
smile  http://www.scratch.mit.edu/users/JDProducers  smile

(Copy and paste in url [adress bar in other words])

I can help you make that save option (if that's what you mean).
-First you will make a variable labled "save" or "load" or something.
-Next you will apply this for all scripts that say - when green flag clicked - and put "only if variable does not equal 1" ( Hint - only do this for scripts that do not interrupt the logo or beginning.)
-Then in one of the sprites put - when green flag clicked - set "save" to 1. That way the first time they play it, it starts from the beginning and after the second time they will pick up where they left off.
-Finally put a new game sprite and use a script saying that every time it is clicked set "save" to 0.

-You're Welcome  big_smile

This topic is 4 years old. I'm sure it has already been answered.  smile


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&amp;display=small

Offline

 

#12 2012-03-09 01:48:06

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Save Engine?

Who necroposted this?!?!  yikes


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

Board footer