GameMaker Room not restarting

J

John Ashmore

Guest
It seems as if the "Restart Room" command is not working. In the below option no variables are reset and the next command setting the score to 8, etc are executed. How to restart the room and have everything including instances, etc, in the room restart along with it? Will I have to restart the game? Is restarting the game possible with a command?

upload_2017-7-20_23-0-45.png
 

Yal

🐧 *penguin noises*
GMC Elder
AFAIK restarting a room only happens at the end of the current event, so those variable changes you have after the start will happen before the room is restarted. Try having a "show message" in the Room Start event of some object present in the room so you can get feedback on whether the room is restarted or not.
 
J

John Ashmore

Guest
OK, I see. So the room is going through the "restart", it is just that no instances or arrays are destroyed. Restarting the room just calls "restart room" commands, is that right? Will I have to reset arrays, etc, manually? I thought instances were meant to be deleted when changing rooms?
 

Yal

🐧 *penguin noises*
GMC Elder
They are, unless they are set to be persistent. They're actually not destroyed, they're just removed, so their destroy events aren't called. Also keep in mind that if you restart the room and end up in the same room, the same objects are created in the same spots again, so if you don't actually CHANGE anything in the room before restarting, nothing will appear to change.
 
Top