B
Bladebss
Guest
hello, I have been getting this problem where when I run my game, it freezes and doesn't show me a bug report or anything I have to close the window my self and I'm non the wiser as to what has gone wrong?
it all started when I put an object spawner into the game, and the code in it is soo simple I just cant see how its causing a problem.
so I have boats that are going along paths I have defined for them to simulate trade routs, when the player collides with one, it ads the room and current coordinates to a global variable so that after the battle has finished the player returns to the room where they left off.
there is a spawner I made in the room that has no sprite its just an object with a creation code that sets the variable "duration" to 1600, then a step event that takes 1 from duration every step and at 0 duration it spawns another boat and resets "duration to 1600, and the boat has a creation code to start the trade route.
this spawner causes the game to freeze after I finish the battle, and should return to the previous room and x,y values as per the global variable.
this is the create event:
this is the step event:
I just don't get how this simple obj can be causing so much trouble!?
if I don't go into battle with the boat,, they spawn happy and fine and go along the trade rout and no freezing, only when I return to the room after battle?
I also have no clue how to work out what I have done wrong as the game just freezes and there's no output in the console.
if I remove this obj from the room all works just fine..? exept.. the boats don't respawn obviously
can any one point me in a direction to solve this?
I just did another quick test and this time is froze only after the battle had finished and I returned to the room and the second the boat spawns in it freezes? the inconsistency of it makes it even more confusing.. I wonder if the freezing on return is because the timer on the spawner has expired and another boat has spawned in so the game freezes before it get to the room? but if I finish the battle quickly enough I get to the room before another boat spawns and freezes the game?
it all started when I put an object spawner into the game, and the code in it is soo simple I just cant see how its causing a problem.
so I have boats that are going along paths I have defined for them to simulate trade routs, when the player collides with one, it ads the room and current coordinates to a global variable so that after the battle has finished the player returns to the room where they left off.
there is a spawner I made in the room that has no sprite its just an object with a creation code that sets the variable "duration" to 1600, then a step event that takes 1 from duration every step and at 0 duration it spawns another boat and resets "duration to 1600, and the boat has a creation code to start the trade route.
this spawner causes the game to freeze after I finish the battle, and should return to the previous room and x,y values as per the global variable.
this is the create event:
Code:
duration=1600;
Code:
duration=duration-1;
if(duration<0){duration=1600 instance_create_layer(x,y,"Ins_char",obj_npc_boat1)};
if I don't go into battle with the boat,, they spawn happy and fine and go along the trade rout and no freezing, only when I return to the room after battle?
I also have no clue how to work out what I have done wrong as the game just freezes and there's no output in the console.
if I remove this obj from the room all works just fine..? exept.. the boats don't respawn obviously
can any one point me in a direction to solve this?
I just did another quick test and this time is froze only after the battle had finished and I returned to the room and the second the boat spawns in it freezes? the inconsistency of it makes it even more confusing.. I wonder if the freezing on return is because the timer on the spawner has expired and another boat has spawned in so the game freezes before it get to the room? but if I finish the battle quickly enough I get to the room before another boat spawns and freezes the game?
Last edited by a moderator: