'Error : Unable to find object <undefined> referenced in event'

Hi, so I deleted an object from my game which had many references. Instead of just deleting it, it spawned an error pop up when I deleted the object, and the object itself just turned into an <undefined> instance and didn't get deleted until I clicked delete on it again. After this, the game hasn't been launching since it says 'Error : Unable to find object <undefined> referenced in event' in Compile window.
I deleted the <undefined> instances from all rooms they were in, and restarted GM, but still no luck.
I didn't think the object exists anymore anywhere in the game, but is there a way to check, either with its old object name, or with the name <undefined> if I've missed it anywhere? Search in Scripts didnt work, and also the object itself has no references (which sometimes I've noticed is not true)
Does this mean it has to still be referenced to somewhere in the game and I just have to keep looking, or is it a bug, for which there'd be a workaround?
Thank you beforehand!
 

TsukaYuriko

☄️
Forum Staff
Moderator
It seems way simpler to me to just load the previous backup or to restore all the files that were affected by it from source control and then just delete it again, but hope it goes well this time. No need to treat the symptoms and aftermath if you can treat the cause. Is this somehow not an option for you?
 
It seems way simpler to me to just load the previous backup or to restore all the files that were affected by it from source control and then just delete it again, but hope it goes well this time. No need to treat the symptoms and aftermath if you can treat the cause. Is this somehow not an option for you?
thanks for reply, the previous backup was from couple days back and I've had quite some work done after that so I'd lose that progress, even tho I could still do it all again of course, i was just looking for a less bothersome alternative if there was any. What exactly do you mean by 'restore all the files that were affected by it from source control ', is there a way to restore the object which caused this mess?
 

TsukaYuriko

☄️
Forum Staff
Moderator
Yes - if you are working with a source control solution such as Git, you are able to restore individual files to previous versions that you've committed. If you are not using source control, you should change this.
 
t
Yes - if you are working with a source control solution such as Git, you are able to restore individual files to previous versions that you've committed. If you are not using source control, you should change this.
thank you! I'm already rapidly reworking a backup from couple days back and adding the stuff that i'd done to the error-giving file of the game, but this source control is useful info for the future to save the trouble.
 

Splitty

Member
Hey! I just had this happen to me and was straight panicking about it.

I actually found a really great work-around. I remembered the object that I deleted and errored out. So instead of working from a back up, I actually just went and got the object file from one of them!
Dragged and dropped it back into my current version and it's all fixed up.


Just wanted to add that solution to this thread. Will update if something goes wrong.


EDIT : its been 2 months of further developing the game, even porting it to GM2 & I still haven't had an issue
 
Last edited:
Top