GML Coming back into a room deletes everything?

J

JakeW

Guest
Hello everyone! Right now I am having a small problem. In my game, the game starts off with a ruined building. Once the player purchases the building it switches sprites. However, I am having an issue that when I switch to a second room, and come back to the main (the one with the sprite switched) the sprite resets itself. I have tried making the objects themselves persistent, which did not work, as well as having the rooms themselves stay persistent, which also did not work. Any help would be greatly appreciated :D
 

2Dcube

Member
When you go into a room, it is created from scratch, this is just how computers work: things are not saved automatically, you have to program it.

You can save changes in global variables or write them into text files. Using save/text files is recommended because you can keep the data even if the player quits the game.
The easiest type of save file is the "ini" file, it is explained in the manual.
 
J

JakeW

Guest
When you go into a room, it is created from scratch, this is just how computers work: things are not saved automatically, you have to program it.

You can save changes in global variables or write them into text files. Using save/text files is recommended because you can keep the data even if the player quits the game.
The easiest type of save file is the "ini" file, it is explained in the manual.
I used global variables but those did not work either. I will go ahead and try the ini file though.
 
J

Jrgreen145

Guest
Hello,

I've been looking into this too, let me know what you find :)

thanks,
jrgreen145
 
L

LewisClark

Guest
I'm pretty sure that this should be as simple as making the room persistent as this saves the state of the room and any instances within the room.

Do you have any code you're using to make the room persistent? Or are you trying using the checkbox in the room editor?
 
Top