This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have the following problem:
Saving to my ini file works fine with everything except levels, when i load it always takes me back to the first room where the save object is. I know the below code does not have anything relevant to rooms cause I removed what I had as it was not working at all, my game would save and load perfectly fine but as soon as I closed the game and opened again it would go back to level one with each load.
No errors
I am trying to:
Create an ini file for saving and loading
Any relevant code
Save Script
if (file_exists("Save.sav")) file_delete("Save.sav");
ini_open("Save.sav");
ini_write_real("Save1", "x", obj_player.x);
ini_write_real("Save1", "y", obj_player.y);
ini_write_real("Save1","points",global.points);
ini_write_real("Save1","seconds",global.seconds);
ini_close();
Load Script
if (file_exists("Save.sav"))
{
ini_open("Save.sav");
obj_player.x = ini_read_real("Save1", "x", 0);
obj_player.y = ini_read_real("Save1", "y", 0);
global.points = ini_read_real("Save1","points",0);
global.second = ini_read_real("Save1","seconds",0);
ini_close();
}
else
{
//do nothing
}
I have tried:
Creating a global.room and just adding 1 to this each time the character goes tot he next room but the issue with that is that my game has diffirent game modes with their own levels and hidden room so that messes up things.
using the code as Shaun Spalding has in his tutorial
I am using:
GameMaker Pro on Steam
GameMaker Language (GML)
Subreddit
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/gamemaker/c...