by makslane » Thu Dec 16, 2004 12:09 pm
You can use saveVars and loadVars to save and load any variables in your game, like highscores, current lives...
To use this functions, you must use the "Save group" field in the "Add New Variable" panel (Variable button in Script Editor).
For example, you create a score variable and put on the "High Score" group.
Now, you create more two variables, lives and energy, and put on "Actor State" group.
When your player die, you can use saveVars("game.sav", "High Score"); to save only the current player high score without save the player state.
When the user exit your game, you can use saveVars("game.sav", "Actor State"); to save the current player state (lives and energy).
Note, you can save different variable groups in a same file (game.sav).
Now, just use loadVars("game.sav", "High Score"); and loadVars("game.sav", "Actor State"); in the proper location in your game!