saving a game help plz

Non-platform specific questions.

saving a game help plz

Postby mrgame » Fri Dec 28, 2007 2:37 pm

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 :)
mrgame
 
Posts: 118
Joined: Sun Oct 21, 2007 8:09 pm
Location: my computer
Score: 3 Give a positive score

Re: saving a game help plz

Postby Bee-Ant » Fri Dec 28, 2007 2:42 pm

You can use saveVars and loadVars function :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: saving a game help plz

Postby mrgame » Fri Dec 28, 2007 3:53 pm

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 :)
mrgame
 
Posts: 118
Joined: Sun Oct 21, 2007 8:09 pm
Location: my computer
Score: 3 Give a positive score

Re: saving a game help plz

Postby Bee-Ant » Sat Dec 29, 2007 2:20 am

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
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: saving a game help plz

Postby mrgame » Mon Dec 31, 2007 9:19 pm

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
mrgame
 
Posts: 118
Joined: Sun Oct 21, 2007 8:09 pm
Location: my computer
Score: 3 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron