Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

4
Ini Load File Loading Incorrect Level
Post Flair (click to view more posts with a particular flair)
Post Body

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)

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
725
Link Karma
658
Comment Karma
10
Profile updated: 1 week ago
Posts updated: 1 day ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago