Page 1 of 1

help for a newbie

PostPosted: Mon Jul 14, 2008 8:36 pm
by CrazyPotatoInc
how do you get games to reset when you win or lose? if you could just post the script, then that would be great. im making the reset button the staples easy button :mrgreen:

Re: help for a newbie

PostPosted: Mon Jul 14, 2008 8:50 pm
by DST
the easiest way to reset an entire game (game over) is to use the loadgame(); function;
Just use loadgame(gamename); and the current game will be dumped and reloaded.

You can save previous score etc. and reload it when the game starts using loadVars and saveVars;

Look in the documentation for proper usage of these functions.

Restarting levels on a game requires a little more coding, and you have to create your game with that in mind; ie, actors spawn somewhere in game mode instead of being placed there in editor mode.

Re: help for a newbie

PostPosted: Mon Jul 14, 2008 10:23 pm
by segwego12
for exe, just put something like domino.exsrhsehrsp, I won't be able to find it and it will reset.

Re: help for a newbie

PostPosted: Mon Jul 14, 2008 10:24 pm
by segwego12
segwego12 wrote:for exe, just put something like domino.exsrhsehrsp, I won't be able to find it and it will reset.

In t he loadgame(); of course. *slaps self*

Re: help for a newbie

PostPosted: Mon Jul 14, 2008 10:25 pm
by segwego12
besides, this should go into support., I think makslane needs to move this.

Re: help for a newbie

PostPosted: Wed Jul 16, 2008 9:28 am
by Bee-Ant
DST wrote:the easiest way to reset an entire game (game over) is to use the loadgame(); function;
Just use loadgame(gamename); and the current game will be dumped and reloaded.

You can save previous score etc. and reload it when the game starts using loadVars and saveVars;

Look in the documentation for proper usage of these functions.

Restarting levels on a game requires a little more coding, and you have to create your game with that in mind; ie, actors spawn somewhere in game mode instead of being placed there in editor mode.

agree...

Re: help for a newbie

PostPosted: Fri Aug 01, 2008 4:41 pm
by CrazyPotatoInc
thanx everyone ill try that.

Re: help for a newbie

PostPosted: Sun Aug 24, 2008 6:45 pm
by Bee-Ant
But LoadGame() function only works for exported project.so dont be wondered if it would says "is not valid game" or something when you run your .ged project,export it first to .exe then test your LoadGame() by run that .exe :D