• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Gamemakers! I need your help!

M

MrStickman

Guest
I'm new, so please don't kill me!
I have a problem with programming.
Actually if you even watched Shaun Spalding's tutorial, you can see, that he made a checkpoint tutorial.
Here comes the problem: When i collide with an enemy, my character instead of respawning just freezes in same place and comes back after few frames. It never dies.
What can I do?
 
Z

zircher

Guest
Also, not need for duplicate posting and your subject line should be meaningful. Something like "Need help with checkpoint logic" rather than a generic plea for help.

Can you post a meaning code fragment so we can base any fixes or questions on actual data?
 
M

MrStickman

Guest
Ok, I have to close the topic, because I fund that in the innitialize room the "persistent" option was on, and that messed everything :V. But thanks for help! Now i know that i can find help on this awesome forum!
 

Landonbay

Member
I am having huge trouble with my checkpoints as well, when I touch the checkpoint, the player just snags right onto it, and can no longer move. I used the same tutorial as well, and am stumped
 
I am having huge trouble with my checkpoints as well, when I touch the checkpoint, the player just snags right onto it, and can no longer move. I used the same tutorial as well, and am stumped
I too have done this tutorial and it works, assuming you did it right ;)

Share you code related to the player colliding with the checkpoint.
 

Landonbay

Member
I too have done this tutorial and it works, assuming you did it right ;)

Share you code related to the player colliding with the checkpoint.
I can,
if (place_meeting(x,y,test))
{
global.checkpoint = id;
global.checkpointx = x;
global.checkpointy = y;
global.checkpointR = room;
}

if (global.checkpoint == room)
{
if (global.checkpoint == id) image_index = 1; else image_index = 0;
}

But all I get is the player ("test" in the code) getting connected and permanently stuck to the object.
 
You must have something some where that is setting your test.x and test.y to the global.checkpointx and global.checkpointy after the collision occurs.
 

Landonbay

Member
You must have something some where that is setting your test.x and test.y to the global.checkpointx and global.checkpointy after the collision occurs.
I see, though I am not sure where. as mentioned, it is basically a similar code to the one in the video, unfortunately, I do not know how to fix this problem. (although knowing my luck, the problem is probably right in front of me.)
 
Share more code then - something is causing your test object to stay at the place of the checkpoint. I am not really sure what it is, though.
 

Landonbay

Member
Share more code then - something is causing your test object to stay at the place of the checkpoint. I am not really sure what it is, though.
for my player object, I had this code into the step (as the tutorial had)

if (global.checkpointR == room)
{
x = global.checkpointx;
y = global.checkpointy;
}

I did remove this code from the test object, and it was able to pass through with no problem, howver, it does not interact with the checkpoint anymore
 
All that should happen when you touch the check point is set the x and y coordinates that your player will spawn when you die. And also maybe an animation or something.
 

Landonbay

Member
All that should happen when you touch the check point is set the x and y coordinates that your player will spawn when you die. And also maybe an animation or something.
I really am at a loss then, unless there is something wrong with the script code, but it is the same as in the tutorial.
there is no animation upon it ATM, all I know is that the player character becomes attached and frozen up to the checkpoint.
 
My point was when you collide with the checkpoint, nothing much really happens. An x and y variable is stored to indicate where you will spawn when you die. As I was saying, I can't remember specifically how the tutorial goes, but there may have been an animation that occurs to the checkpoint once you collide as well.

Code:
if (global.checkpointR == room)
{
x = global.checkpointx;
y = global.checkpointy;
}
The reason this code made you stick is EVERY step of your player, you were resetting your player's x and y values to that of the global.checkpointx and y that you stored on collision. That code should be in your player's create event, so it fires once when the player is added to the room (typically after a room_restart() when you die).
 
Top