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

#26 2010-09-19 12:04:47

Scratchthatguys
Scratcher
Registered: 2010-07-16
Posts: 1000+

Re: How do I make a in game save/load function

Thomas96 wrote:

vortex19 wrote:

I think this is the script you're looking for:


<when I receive[ save game
delete "all" on list "save list"
add <x position> to "save list"
add <y position> to "save list"
add <{ Score }> to "save list"
etc.


And when you load the game...


<when I receive[ load game
<set x to( item 1 on "save list" )>
<set y to( item 2 on "save list" )>
<set{ Score }to( item 3 on "save list" )>
etc.

Scratchthatguys wrote:

<when green flag clicked>
<forever>
<if><< mouse touching save <and>and mouse down
<set{savedx }to(<x position>
<set{savedy }to( <y position>
<set{savedd }to( <direction>
<stop script> >>
is my save script, and
<when green flag clicked>
<forever>
<go to x sad  savedx )y sad  savedy
<point in direction( savedd
<stop script>
was my load script.

However, this only works offline and if you save the project after you activate the save script.

f the project was to be compiled to an .exe file would the permanent saving work?

I assume if it was an EXE you could add extra scripting to add to the Scratch.changes file

Offline

 

#27 2010-10-22 22:27:19

LucasGamer
Scratcher
Registered: 2010-05-08
Posts: 100+

Re: How do I make a in game save/load function

im making an rpg and im using an easy save feature. the save thing on the scratch program!! All you have to do is download the game and then play, and save it when your done! just dont make it reset the variables at the start, so just keep saving b4 testing  big_smile


Check out my new game, LightSpeed!
http://scratch.mit.edu/projects/LucasGamer/1591684

Offline

 

Board footer