D
ddabrahim
Guest
Hi.
I'm relatively new to GMS, I am working on a small project and now I'm experiencing a weird error and I can't figure out what is causing it.
I believe it got something to do with the order of execution under the hood in GMS.
The story:
I'm using GMS2 and GML. I have created a Game room and setup the entire game in this room. No problem there, the game runs fine. Next I have created a new room just below the Game room only to use it as a Game Over screen.
If you lost or win the game, it go to the End room and simply ask you to press enter to start the game again and if you press enter it does go back to the Game room and the game start all over again. No problem with that, it works fine. Now the weird part. I figured, okay I create a room above the Game room to display a menu only to start the game room, nothing fancy only asking the player to press enter to start the game. If the player press enter, it supposed to go to the Game room but it does not work.
What happens is, when I press enter in the Menu room, it does go to the Game room but then immediately jump to the End room. It is obviously got something to do with the logic I created when to go to the End room from the Game room. So I was playing around with it but could not figure out what the problem is. As a final thing to try I have commented out the entire code that ends the game and go to the End room. Now if I press enter in the menu room, the game do start up but instances are not being created in the room and I have no clue why. The instance supposed to be created in the Create event of the GameController which is added to the Game room, so when the Game room starts why the Create event doesn't get executed and why the instances are not being created?
Of course I don't expect anyone to be able to help me without looking at the actual project. I suspect, it got something to do with the order things are executed in GMS under the hood.
Could anyone list the order of execution please?
Like:
1. Room create
2. Create instances of object
3. Run Create event of instances
4. Run room create code
5. run Step event of all instances.
Something like this, the more detailed the better. I'm hoping if I know the order in more detail then maybe I can figure out what is wrong.
Or in case someone did experienced a similar problem, what was the problem?
I would appreciate any help.
Thanks in advance.
I'm relatively new to GMS, I am working on a small project and now I'm experiencing a weird error and I can't figure out what is causing it.
I believe it got something to do with the order of execution under the hood in GMS.
The story:
I'm using GMS2 and GML. I have created a Game room and setup the entire game in this room. No problem there, the game runs fine. Next I have created a new room just below the Game room only to use it as a Game Over screen.
If you lost or win the game, it go to the End room and simply ask you to press enter to start the game again and if you press enter it does go back to the Game room and the game start all over again. No problem with that, it works fine. Now the weird part. I figured, okay I create a room above the Game room to display a menu only to start the game room, nothing fancy only asking the player to press enter to start the game. If the player press enter, it supposed to go to the Game room but it does not work.
What happens is, when I press enter in the Menu room, it does go to the Game room but then immediately jump to the End room. It is obviously got something to do with the logic I created when to go to the End room from the Game room. So I was playing around with it but could not figure out what the problem is. As a final thing to try I have commented out the entire code that ends the game and go to the End room. Now if I press enter in the menu room, the game do start up but instances are not being created in the room and I have no clue why. The instance supposed to be created in the Create event of the GameController which is added to the Game room, so when the Game room starts why the Create event doesn't get executed and why the instances are not being created?
Of course I don't expect anyone to be able to help me without looking at the actual project. I suspect, it got something to do with the order things are executed in GMS under the hood.
Could anyone list the order of execution please?
Like:
1. Room create
2. Create instances of object
3. Run Create event of instances
4. Run room create code
5. run Step event of all instances.
Something like this, the more detailed the better. I'm hoping if I know the order in more detail then maybe I can figure out what is wrong.
Or in case someone did experienced a similar problem, what was the problem?
I would appreciate any help.
Thanks in advance.
Last edited by a moderator: