• 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!

[solved]Room changes suddenly not working

W

Wild_West

Guest
I added some changes to my player parent code to give him invincibility and ever since I've been getting problems that I shouldn't be.

My warp object isn't changing rooms when I collide with it, and my rooms aren't restarting when I die. They just keep repeating the messages they're supposed to show.
And I haven't touched the code that says to do so at all since the last time it was working before I made the adjustments for invincibility.

//allow player death
if (west_stats.hp <= 0) and not instance_exists(fayth_object)
{
show_message("Game Over..");
room_persistent = false;
room_restart();
}

if (west_stats.hp <= 0) and instance_exists(fayth_object) and (fayth_object.checkpoint_reached == false)
{
show_message("Game Over..");
room_persistent = false;
room_restart();
}

///warp in collision with player
if(room != the_6_bonuses_room){ room_persistent = false; }

room_goto(map_select_room);
 
Last edited by a moderator:
I

Insanebrio

Guest
I found this phrase in the room_restart() function description:
Note that the room will not be restarted until the end of the event where the function was called, so any code after this has been called will still run.
Do you have other code after that one you posted? Maybe a room_persistent=true?
 
W

Wild_West

Guest
I found this phrase in the room_restart() function description:
Note that the room will not be restarted until the end of the event where the function was called, so any code after this has been called will still run.
Do you have other code after that one you posted? Maybe a room_persistent=true?

I do have code that's in the player parent step event with the death code but It's for a collision with a moving platform, that's the only new thing I added recently. Could that be it?
 
I

Insanebrio

Guest
I dont think so. Thats a strange bug so I think you should try removing what you added and see if the games goes back to work again. Honestly im not a persistent fan, since I dont like the fact that something.may persist by mistake and generate strange effects, but if you watch out well that should not happen.
 
W

Wild_West

Guest
I dont think so. Thats a strange bug so I think you should try removing what you added and see if the games goes back to work again. Honestly im not a persistent fan, since I dont like the fact that something.may persist by mistake and generate strange effects, but if you watch out well that should not happen.
Sorry I found ou what it was after like another hour of staring at my player code.
I had recently commented out a section of the code that was resetting his hp and all that whenever the room restarted because it was resetting whenever I opened a menu too, so I just forgot to fix that and uncomment out the code so his hp would actually RESET upon death enabling the rst of the code to run.

So I fixed the death code and hp reset and now I got it back to where it was.
Really dumb oversight I know. :p
 
Top