• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

[SOLVED] Adding new object to a room makes code start acting weird.

basementApe

Member
Ok, so this one breaks my mind a little bit.

I updated from 2.2.5 to 2.3 about a week ago. There were a couple of hiccups, but overall the transition went fine. But yesterday I tried to add a new object into my test level and BOOM. All of a sudden room_goto_next(); starts going to the wrong room in the list! Instead of going to room index 1 after the startup room, it now goes to room index 2. Deleting the new object from the test room will have room_goto_next(); behaving normally again. What's going on here??

Another weird thing happened when adding this new object to my test room. Suddenly this code segment here...

GML:
if keyboard_check_pressed(ord("V"))

{

    if global.DebugCollisions == 0

    { global.DebugCollisions=1; }

    else if global.DebugCollisions == 1

    { global.DebugCollisions = 0; }

}
... stopped doing anything at all! And again, if I delete the new object from the test room, things go back to normal.

There's nothing special about the new object I created. No events, no nothing. It's a non-solid, non-persistent, visible object with a small sprite attached to it. That's it!

I'm a bit scared to add additional new objects to my project now. Who knows what will happen?

Is this a bug? Sure seems like it. Has anyone else had this happen to them before?
 

basementApe

Member
Okay, it seems like from 2.3 onwards, GMS will save the project filename internally. So if you rename it, GMS will disregard your renamed project file and just create a new one with the original name instead. I was trying to use the renamed file, while GMS would never save any changes I made to that file. It works fine now as long as I don't try to rename the project file.
 

Pixel-Team

Master of Pixel-Fu
As for the rooms, make sure you check Room Order, that your levels are in the correct order you want.
 
Top