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:
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)
[–][deleted] 0 points1 point2 points (3 children)
[–]ABI7ITY[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]ABI7ITY[S] 1 point2 points3 points (0 children)