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
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
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.
Offline
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
Offline
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
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) endThere is two variables I made to use this, score and high score.
don't forget to close the scratchblocks
[scratchblocks] code here [/scratchblocks]
Offline
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
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) endThere 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) endWoops, just noticed after typing it up that you'd typed it...
Offline
Hi, I'm JDProducers, check out my projects here-
http://www.scratch.mit.edu/users/JDProducers
(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
Offline
JDProducers wrote:
Hi, I'm JDProducers, check out my projects here-
http://www.scratch.mit.edu/users/JDProducers
![]()
(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![]()
This topic is 4 years old. I'm sure it has already been answered.
Offline
Who necroposted this?!?!
Offline