SkullCrush3rZA
Member
I am 20 hrs into a game creation (following the space rocks DND tutorial and spicing it up my way). When I run the game after I created the 9th object (and its sprite), I kept getting an error as soon as the object instance creation is triggered (there’s nothing funny or special about the instance creation event/action). After several Google attempts that got me nowhere, I discovered that when I reloaded the project, GM discarded the new object and sprite but kept any other changes. Weird.
The error relates to the object (ie. obj_game) that triggers the new object’s instance creation (obj_Alien). An extract of the error reads as follows: “Variable obj_game.obj_Alien(***,***) not set before reading it.” (I replaced numbers with ***.)
What I figured out, is that even though the new object and its sprite exists in GM, when I press F5 to run the game, the new object and sprite do not exist. I realized this when I quit GM, restarted my laptop, launched GM and reloaded my project. Suddenly, the new object and its sprite were missing. And here’s a few weirder problems:
1.) Changes I made after I created the new object & sprite, were still saved;
2.) I redid the object and sprite, saved the project without running the game first, but still, as soon as I reloaded the project, the new object and sprite were again missing, even though any other changes were saved. (Eventually I discovered I am not able to create any new sprites either. As soon as I save/close/relaunch/reload the project, the sprite is removed.)
3.) The first time I recreated the object and sprite from scratch, this happened: I first recreated the sprite. (I later realized that the sprite was not lost as it was saved on my hard drive and could simply be imported.) I then recreated the object, and linked it to the sprite (or vice versa, whatever). Obviously, the new object still had no events yet. So I started by creating a “Create” event. As soon as I did that, the “Create” event filled itself automatically with the content I designed before. Weird, right? Anyway, subsequent attempts to recreate the object from scratch did not magically fill the event contents again.
So, what the hell is going on?!
I have the free version of GM Studio 2 (updated to the latest version yesterday).
A Reddit user suggested I open the project’s YYP file in NotePad and find the resources lines relating to the sprite and object, and then to delete those two lines. The YYP file doesn’t have any lines related to the new sprite or new object.
What else should I try?
The error relates to the object (ie. obj_game) that triggers the new object’s instance creation (obj_Alien). An extract of the error reads as follows: “Variable obj_game.obj_Alien(***,***) not set before reading it.” (I replaced numbers with ***.)
What I figured out, is that even though the new object and its sprite exists in GM, when I press F5 to run the game, the new object and sprite do not exist. I realized this when I quit GM, restarted my laptop, launched GM and reloaded my project. Suddenly, the new object and its sprite were missing. And here’s a few weirder problems:
1.) Changes I made after I created the new object & sprite, were still saved;
2.) I redid the object and sprite, saved the project without running the game first, but still, as soon as I reloaded the project, the new object and sprite were again missing, even though any other changes were saved. (Eventually I discovered I am not able to create any new sprites either. As soon as I save/close/relaunch/reload the project, the sprite is removed.)
3.) The first time I recreated the object and sprite from scratch, this happened: I first recreated the sprite. (I later realized that the sprite was not lost as it was saved on my hard drive and could simply be imported.) I then recreated the object, and linked it to the sprite (or vice versa, whatever). Obviously, the new object still had no events yet. So I started by creating a “Create” event. As soon as I did that, the “Create” event filled itself automatically with the content I designed before. Weird, right? Anyway, subsequent attempts to recreate the object from scratch did not magically fill the event contents again.
So, what the hell is going on?!
I have the free version of GM Studio 2 (updated to the latest version yesterday).
A Reddit user suggested I open the project’s YYP file in NotePad and find the resources lines relating to the sprite and object, and then to delete those two lines. The YYP file doesn’t have any lines related to the new sprite or new object.
What else should I try?