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

Need Help - Code appearing in wrong events

Hey there, I've been developing a game project by myself coming up on 5 years now, and I have only just recently run into an issue that is causing a great bit of stress.

It seems as though as I'm working on a project over the past week, doing occasional compiling and adding small things here and there, I run into an issue where code from one event will jump into another event, completely replacing it. It seems to occur in strange places here and there with no rhyme or reason. The result is a lot of weird behavior and crashing within the game.

I only have one idea as to what significant change might have caused this, as I did install the extension mentioned below relatively recently:
For those who are familiar with this extension, it fixes an issue where 60fps games would run at 45fps and hog a ton of resources on Windows 10 machines. The extension did fix that issue, but for all I know it might be related to the new problem I'm having here.

Like I said, I've been working on this game for the past 5 years and have not encountered this issue until just recently. Could really use help here.
 
Last edited:
I can confirm with certainty that the patch you've linked there has nothing to do with the bug you're experiencing.

The "code appearing in the wrong event" bug has plagued the 1.4 IDE for many many years, and nobody has been able to put a finger on what causes it. I have only experienced it a couple of times, but they're very memorable as the last place you're going to look for a bug is in a completely unrelated event.

Plus, I don't think .dlls have any effect on the IDE.
 
I can confirm with certainty that the patch you've linked there has nothing to do with the bug you're experiencing.

The "code appearing in the wrong event" bug has plagued the 1.4 IDE for many many years, and nobody has been able to put a finger on what causes it. I have only experienced it a couple of times, but they're very memorable as the last place you're going to look for a bug is in a completely unrelated event.

Plus, I don't think .dlls have any effect on the IDE.
Do you have any recommendations on better practices or behaviors that might lessen the chances of issues like this occurring? I had looked at other mentioned instances of this problem in the forum, and I've seen recommendations along the lines of: "Try to have a few code windows open at any given time". Is there anything else that can be done to mitigate the problem? Different GMS versions perhaps? I tried to use 1.4.9999 but any games I would compile kept immediately closing/crashing out.
 
"Try to have a few code windows open at any given time"
I would have assumed doing this increases the chance of these types of issues, but to be honest I always have like 15 windows open and it hasn't happened to me for a while.

I tried to use 1.4.9999 but any games I would compile kept immediately closing/crashing out.
I would definitely recommend using this version, it's worth fixing whatever issues your games have, or at least ensuring any new projects you start are started using this version.

Honestly, it happens so little for me now I just ensure I always have my project backed up with source control, and remember that it is a possibility when there's a bug I can't figure out.

If it's happening consistently for you, maybe it's worth screen recording while you work and then you could go back through and see if there are any patterns. But this would all be time spent not working so it might just be more efficient to power on through.

Out of curiosity, which events are getting replaced? For me it was always 'create events' suddenly containing 'step event' code. I now tend to have all my game logic in a single object so perhaps that's why I'm experiencing it less. If keeping all the code windows open can stop it happening, it's very likely my entire object code is always open so it cannot get replaced!
 
I would have assumed doing this increases the chance of these types of issues, but to be honest I always have like 15 windows open and it hasn't happened to me for a while.
My apologies, I meant to say I am trying to have AS FEW windows open as possible, but I think we're on the same page there.

I would definitely recommend using this version, it's worth fixing whatever issues your games have, or at least ensuring any new projects you start are started using this version.
I tried installing 1.4.9999 but was having issues doing a test play compile. The game would close out almost the moment it started up. I did take a look at your thread for setting up a fresh install of GM 1.4.9999, and I saw a mention of a fix for a compiler error (dxwebsetup.exe) Not sure if that would act as a fix for my situation?

Honestly, it happens so little for me now I just ensure I always have my project backed up with source control, and remember that it is a possibility when there's a bug I can't figure out.

If it's happening consistently for you, maybe it's worth screen recording while you work and then you could go back through and see if there are any patterns. But this would all be time spent not working so it might just be more efficient to power on through.
Tracking down what has changed has been a little difficult (although sometimes the problems are more obvious based on the resulting glitches). Doesn't seem to be tied to code that I've interacted with for a long time. Will definitely be keeping a more accurate log of changes from now though, as well as far more frequent backups.


Out of curiosity, which events are getting replaced? For me it was always 'create events' suddenly containing 'step event' code. I now tend to have all my game logic in a single object so perhaps that's why I'm experiencing it less. If keeping all the code windows open can stop it happening, it's very likely my entire object code is always open so it cannot get replaced!
It seems like it's alarms copying into other alarms. Seems to happen within the same object, so maybe that's a hint to something? Might try condensing code down into a lot less objects from now on though.
 
Well you could always try ;). The dxwebsetup is to fix YYC though, not just regular compiles.

What's happening for you? You just run an empty project and the compiled window just opens and closes?
I run my current project, which is a nearly finished game in the compiler window, which just opens and closes. Sometimes I get to get a glimpse of the start screen, other times it flashes up so briefly I can only se the gamemaker logo for a moment.

The code copying problem happened again, this time within a window I was editing a lot. Which I suppose is "better" if it only does that, cause I can track down and fix the problem easier.

It wouldn't have anything to do with having a very large library of objects would it? Nor would it have anything to do with Windows 10?
 
Nor would it have anything to do with Windows 10?
Definitely not this, I only recently upgraded to it.

Sometimes I get to get a glimpse of the start screen, other times it flashes up so briefly I can only se the gamemaker logo for a moment.
Ok so it's definitely a code thing. Perhaps if you launch the debugger and really quickly pause the game, then you can step through the code and see which line causes it to close
 
Top