Page 1 of 1

save and restart

PostPosted: Sat Oct 27, 2007 10:37 pm
by mrgame
i need a way to
(1) RESTART THE GAME
(2) create either a save/load option
(2) or create checkpoitns ( walk over the check point then when u die you go back to there but everything els is the same as then)
eg say i kill a monster and move a box. the box goes back to where it was and the enimy is not dead or perhaps not ever created ect..

Re: save and restart

PostPosted: Thu Nov 29, 2007 8:47 pm
by Troodon
To restart the game, just use the loadGame function from the list in script editor. :D

There is basic save and load function based on one memory slot and advanced save/load based on stuff Sparky is specialised in. Which one you need?

You can create two new variables ,saveX and saveY and calibrate them everytime you collide with a checkpoint. :)

Re: save and restart

PostPosted: Sun Dec 02, 2007 9:01 pm
by mrgame
u see what i wanted was when i touch a checkpoint and die. it reloads the game from that point
everything like health and where the enimys were i need it to actuly load from that point so is it possible?

Re: save and restart

PostPosted: Mon Dec 03, 2007 5:37 am
by Troodon
Yeah, sure! :)
Just save the health and stuff variables just like the coordinate variables.

Re: save and restart

PostPosted: Mon Dec 03, 2007 8:09 pm
by mrgame
im such an idiot why didnt i think of that. thx

it works for most of it but not all of it. ty anyways :)

Re: save and restart

PostPosted: Tue Dec 04, 2007 2:04 pm
by Troodon
:)
What things aren't working?

Re: save and restart

PostPosted: Tue Dec 04, 2007 2:30 pm
by Bee-Ant
Create checkpoints should be no.3... :lol:
To restart the game, use LoadGame function like Mike said...
You could make checkpoints with LoadGame,saveVars and loadVars functions...maybe
make cp variable...(cp=checkpoints),global and save it in a group ("atr" for example)
When player collide with checkpoint1 :
Code: Select all
cp++;
saveVars("data.dat","atr");
LoadGame("MIssion1CheckPoint1.exe");

And destroy checkpoint1 actor when it collided with your player...
In Mission1CheckPoint1 of any character, CreateActor, ScriptEditor
Code: Select all
loadVars("data.dat","atr");

I'm not try it yet...but it should work... :D