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.

3
How to save/load separate x and y of an object in ini file
Post Flair (click to view more posts with a particular flair)
Post Body

Hi guys. I have run into a really annoying problem, please can someone give me a hand <3

I have the following problem:

I have a moving object I am using in my game, this object is used more than a few times in a level and I need to save and load each ones x and y into an ini file, the reason why is because my character has to jump on these objects to get from one platform to another. I created a script that does save the object but the issue is that it is saving all instances of that object in one x and y, so when I load again all the object are together in one place and the level is unplayable.

Current save scripts:

if (file_exists("PlatformPosition.sav")) file_delete("PlatformPosition.sav");
{
ini_open("PlatformPosition.sav");
ini_write_real("Save1", "y", obj_moving_platform.y);
ini_write_real("Save1", "x", obj_moving_platform.x);
ini_close();
}

Current load script:

if (file_exists("PlatformPosition.sav"))
{
ini_open("PlatformPosition.sav");
obj_moving_platform.y = ini_read_real("Save1", "y", 0);
obj_moving_platform.x = ini_read_real("Save1", "x", 0);
ini_close();
}

I have tried: I'm not sure what to try, I have googled and looked at the manual to try find how to save separate x and y for multiples of the same object but have not found anything.

I am using: GameMaker pro on Steam

Much Love ABI7ITY

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