Page 1 of 1

saving a game help plz

PostPosted: Fri Dec 28, 2007 2:37 pm
by mrgame
im making a multiplayer puzzle top down rpg. and i need a way to be able to save the game then shut it down then if i re open it i can start from were i was or use a load game function to load game files.
i just need to know if its possible
and the basics how :)

Re: saving a game help plz

PostPosted: Fri Dec 28, 2007 2:42 pm
by Bee-Ant
You can use saveVars and loadVars function :D

Re: saving a game help plz

PostPosted: Fri Dec 28, 2007 3:53 pm
by mrgame
so will that work if i close the game down and open it up again?

and i sopose that means ive got to make vars that are about

where player 1 is
where player 2 is
if player 2 is playing
what one of the 4 outfits player 1 is wearing
player 1's hp
player 2's hp
player 1's lvl
player 2's lvl
player 1's lvlup points
player 2's lvl up points
player 1's seeing skill
" " runing skill
" " logic skill
player 2's seeing skill
" " running skill
" " logic skill
player 1's xp
player 2's xp
and more when i start adding in more puzzle levels...... why isnt there a save game function........... this might take awhile


EDIT
also what about independant user variables the ones that arnt in groups and it cant load them coz it needs a group. so that method has gone down the drain. any other ideas :)

Re: saving a game help plz

PostPosted: Sat Dec 29, 2007 2:20 am
by Bee-Ant
You can save player 1 and player 2 attributes with saveVars and loadVars, their position in x and y axis also...
Yeah, you need groups, save all player 1 variables in a "p1" group and player 2 variables in "p2" group.
When you open your game, put this code
Code: Select all
loadVars("p1data.dat","p1");
loadVars("p2data.dat","p2");

And before shutdown it, put this code
Code: Select all
saveVars("p1data.dat","p1");
saveVars("p2data.dat","p2");
ExitGame();



PS : If still cant understood, I'll explain later...this is so easy

Re: saving a game help plz

PostPosted: Mon Dec 31, 2007 9:19 pm
by mrgame
ye i understand the like save vars ive done this before but i was wondering if there was just a save game state this would be much easyer.... anyway looks like i got one hell loads of work to do