Save game?

Talk about making games.

Postby makslane » Mon Feb 23, 2004 5:38 pm

Your global code is ok, so:

On Create Actor, put:

lives = 0;
loadLives();
test.textNumber = lives;

On Key Down (c):

lives++;
test.textNumber = lives;

On Key Down (x):

saveLives();
ExitGame();
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Mon Feb 23, 2004 5:54 pm

:lol: Wow IT'S WORKING IT'S WORKING ! i'm so happy and so thankful to YOU :P :P :P

GE's GREAT
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby ingsan » Sat Apr 24, 2004 10:18 am

Hello everyone !
Yeah it's me again asking questions about saving game ... sorry :D

I followed makslane's advice concerning saving and loading vars and it works wonderfully (It's so awesome :shock: !)
This time I am wondering if that could be used to save Timers' time too. For ex I have a timer of 9000 ms on runtime but I quit when timer has only reached 5000 ms. Is there a possibility, when loading the saved game, to get back the timer where we have left it ie 5000 ms ?

Any idea ? :?
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Sat Apr 24, 2004 6:24 pm

You can save a var with remain time and use it to create a new timer with this value in the Script Editor:

CreateTimer("Event Actor", "your timer", savedValue);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Sat Apr 24, 2004 6:33 pm

So savedValue = variable for ActualTime in ms when game is saved. How can I declare that savedValue = ActualTime. Where can i point this ?
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Sat Apr 24, 2004 6:52 pm

Use a gloval var,
On some Create Actor, init the var:
savedValue = 9000;

and make your changes...
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Sat Apr 24, 2004 7:25 pm

:oops: got it
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron