Page 2 of 2
Re: Tutorial: Making Checkpoints

Posted:
Mon Jun 27, 2011 9:29 pm
by again
OK click on view
click on draw actor
click on add action
click on script editor
view.x=(players name).x-150;
Now the view should follow the actor , adjust the -150 to whereever is comfurtable for you.
Re: Tutorial: Making Checkpoints

Posted:
Wed Jul 20, 2011 1:23 am
by raminjoon
hey bee ant I was wondering to know how you can save your game file. my game plot is where only one ball crosses my screen and after its off the screen I have another game file to be loaded in order for a ball with different color to come on screen. so how can I make a score archive which will save all game datas/levels into one archive .ged file. if I am not making sense plz reply for detail explanation.
Re: Tutorial: Making Checkpoints

Posted:
Wed Jul 20, 2011 2:39 am
by skydereign
Why are you using multiple ged files for that? By the sound of it, you could either change the rgb values or perhaps the animation of the ball, and only use one file. But, to make the score transfer between files just create a variable, add it to a save group, and when you want to load the next game, you do something like this.
- Code: Select all
saveVars("save_file", "group");
LoadGame("game_file");
And in some create event, put this.
- Code: Select all
loadVars("save_file", "group");
One thing though is that every file needs to have that variable and have it in the group.
Re: Tutorial: Making Checkpoints

Posted:
Wed Jul 20, 2011 3:16 am
by bilvyy
The checkpoint works great, thank you! I do have a problem though. When my character walks through a door (which uses the DestroyActor event), he always appears at the checkpoint, instead of where I had connected the door to. I have a feeling this is because of the Create Actor event, so is there a way to fix it so I can keep the CreateActor event and still use Destroy/Create for my doors?
Re: Tutorial: Making Checkpoints

Posted:
Wed Apr 18, 2012 8:37 pm
by happyjustbecause
Hello,
I've been trying to add checkpoints into my game, and I came across this tutorial. I did most everything of what the tutorial said, I didn't add saveVars, or loadVars because I don't feel like having the game start at the checkpoint when replaying the game at this point. I also didn't add the save to group, so it shouldn't have problems. But as soon as my character dies, or is destroyed, gameEditor crashes. There must be something wrong with the PosX and PosY variables? Is there some reason it is crashing? Do I need to save the variables or something?
Re: Tutorial: Making Checkpoints

Posted:
Wed Apr 18, 2012 9:09 pm
by skydereign
Nothing about this tutorial should cause a crash in your game. There must be something else that adding this effects in your game.
Re: Tutorial: Making Checkpoints

Posted:
Thu Apr 19, 2012 4:49 pm
by Hblade
Another good way is to make an array like this:
- Code: Select all
//global code
int chkPos[2], viewPos[2];
This allows you to store the players/views X and Y. Like so:
- Code: Select all
//player's draw actor
chkPos[0]=x;
chkPos[1]=y;
viewPos[0]=view.x;
viewPos[1]=view.y;

now when loading the checkpoint:
- Code: Select all
x=chkPos[0];
y=chkPos[1];
view.x=viewPos[0];
view.y=viewPos[1];
This is how I would do it

Bee's method is more user friendly though :3
Re: Tutorial: Making Checkpoints

Posted:
Thu Apr 19, 2012 8:34 pm
by happyjustbecause
Hblade wrote:Another good way is to make an array like this:
- Code: Select all
//global code
int chkPos[2], viewPos[2];
This allows you to store the players/views X and Y. Like so:
- Code: Select all
//player's draw actor
chkPos[0]=x;
chkPos[1]=y;
viewPos[0]=view.x;
viewPos[1]=view.y;

now when loading the checkpoint:
- Code: Select all
x=chkPos[0];
y=chkPos[1];
view.x=viewPos[0];
view.y=viewPos[1];
This is how I would do it

Bee's method is more user friendly though :3
Hmm, I'll try that out, because I can't seem to prevent the crashing of gameEditor with the original method. Thanks both of you though!