Page 1 of 1

save game

PostPosted: Sat Jul 21, 2012 7:59 pm
by erfan71
how can we save state of a player in the game?

for example he puts F5 and quick save and then closes the game

and then opens the game presses load game and comes back from last state?

do we must use file?

how?

please help me i am new to Game-Editor.

Re: save game

PostPosted: Sat Jul 21, 2012 8:12 pm
by skydereign
You should search the forums for saveVars/loadVars tutorials. They're pretty detailed and it'll get you used to searching the forums. To address the question though, you'll need to use the saveVars and loadVars functions. Since you are saving the state of the player, you'll need at least the player's x and y variables. Bee-Ant's checkpoint tutorial can explain most of what you need to do. The only thing you need to add is when you start the game (when the player is created, you call loadVars, and change the player's position to the loaded xy position). http://game-editor.com/forum/viewtopic.php?f=27&t=8744&p=66448&

Re: save game

PostPosted: Sat Jul 21, 2012 8:59 pm
by erfan71
ok thanks.