lol, I'm sorry to say that, but I read this post for the first time. As I scrolled down I more and more became like

.
Never mind that now, lemme explain:
There are global variables (which apply to all actors in the game)
and actor variables (which only apply to only one actor)
Example for global variable: You set a gravity which can change during the game. But you'd like every actor to obey its force.
Example for actor variable: Your hero finds himself in front of a bunch of hideous enemies. He starts killing them. Everyone has a certain health. But the "actor variable" has the advantage that you don't have to create a new health variable for each individual clone, but only one variable for everyone. If you shoot him only his health goes down and he dies. With a global variable, every enemy would've died when you killed only one! That's kinda funny (give or take a little) but it doesn't serve the purpose.
So much for the variables.
If you want script examples, just ask for 'em.
Now, let's turn our attention to the saving/loading.
In this case, we want to save the level we're in.
First create a global variable called "level" and the save group called "data" (this is important!) and the level variable gets higher every time you complete a level.
Collision -> goal ->
- Code: Select all
level = level + 1;
Still with me? good.
Now add a saving button.
Add the event "mouse button down (left)" and select the Script Editor as action.
Then (if you're not familiar with the scripting) open the variable-and-function panel.
You'll find a variety of stuff you can select there (including your own level variable which you should be proud of

).
Select the SaveVars function. A window will appear asking for the variable, the group and the file it should be saved in.
Now you can decide what to enter. Call the file whatever you want, just MAKE SURE that it's exactly the same file when you LOAD the variables. Select the "data" save group which you've created previously along with your level variable (if you still remember XD). Groups are there for your variables in order not to get messed up. Once you completed that step, click "ok". The code should basically look like that:
- Code: Select all
saveVars("data", "data");
That's done it! You've saved your level! (This is a very simple way, believe it or not).
Now to the loading:
Create a load button
MouseButton down -> LoadButton
- Code: Select all
loadVars("data", "data");
And now you've loaded the level variable.
From there, you can let your actor take certain actions depending on the level variable, such as changing his position if the level equals a certain number.
I hope that helped.
-K@ll