save var

Talk about making games.

save var

Postby Behdadsoft » Fri Apr 08, 2011 4:31 pm

Hi

I put the variables are stored, are stored in a folder. To do this, what should I do?
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: save var

Postby skydereign » Fri Apr 08, 2011 11:28 pm

Use the saveVars function. When you put a variable in a save group, you just need to save the save group. This is from the script reference.
http://game-editor.com/docs/script_reference.htm

Save functions
Use saveVars and loadVars to save and load any variables in a game, like highscores, current lives, etc. To use these functions, you must use the "Save group" field in the "Add New Variable" panel (Variable button in the Script Editor).
saveVars: Save all variables in the group to the specified file.
The file will be saved in the game directory.
void saveVars(char *file, char *group)
Use saveVars to save any variables in a game; highscores, current lives, etc.
You must use the "Save group" field in the "Add New Variable"panel (Variable button in the Script Editor).

Script Editor Syntax:
saveVars("game.sav", "High Score");

loadVars: Load all the variables in the group from a specified file.
void loadVars(char *file, char *group)


Script Editor Syntax:
loadVars("game.sav", "High Score");

Example:
1. Create a "score" variable and put it in the "High Score" group.
2. Create two more variables: "lives" and "energy". Put these variables in the "Actor State" group.

When the player dies, use saveVars("game.sav", "High Score"); to save the current player's high score without saving the player's state.
When the user exits the game, use saveVars("game.sav", "Actor State"); to save the current player's state (lives and energy).
Note: different variable groups can be saved in the same file (game.sav).
Finally, use loadVars("game.sav", "High Score"); and loadVars("game.sav", "Actor State"); in the proper script editor area of the game!
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: save var

Postby Behdadsoft » Sat Apr 09, 2011 7:29 am

Thank you, but I mean not just speech.
I like variables in a folder named save, they save
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: save var

Postby skydereign » Sat Apr 09, 2011 7:34 am

Oh, assuming I understand you this time, if you want to put the save file in a folder in your game directory you can't.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: save var

Postby Behdadsoft » Sat Apr 09, 2011 12:50 pm

No matter, thank you.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest