• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 Trouble with saving ini files...

Hi, I'm new to the forum so I hope I'm brief. I've been having trouble with saving and loading my game after exporting the package. I am exporting out of uwp so I'm assuming that's where the problem lies, considering how its set up, but just an assumption. This is what my save script looks like:
Code:
ini_open("save.ini");
ini_write_real("Save","level",global.currentLevel);
ini_write_real("Jump","jumpback",global.jumpBack);
ini_write_real("Freeze","freeze",global.freeze);
ini_write_real("Burst","burst",global.burst);
ini_close();
And this is what my load script looks like:
Code:
ini_open("save.ini");
global.currentLevel = ini_read_real("Save","level",0);
global.jumpBack = ini_read_real("Jump","jumpback",0);
global.freeze = ini_read_real("Freeze","freeze",0);
global.burst = ini_read_real("Burst","burst",0);
ini_close();
So through testing, it works fine. I can close the program and start it up again and still have my previous save. However, after I create the uwp package, no information seems to be saved. I'm not sure if I have to call the data in a different way or whatnot but i'm drawing a blank on why it works through testing and not the package. I should mention I'm not to familiar with the async side of things, so I'm wondering if I have to go that route. Any help would be much appreciated, thank you.

P.S. sorry if I'm in the wrong thread
 
Last edited:
Hi there, thank you for replying! I can't get to my computer at the moment, but during my troubleshooting, I did use this:
Code:
ini_open(working_directory + "/save.ini");
Unfortunately, it was the same result, worked in testing, but not for the package. I also tried different formats like 'save.dat', 'save.sav', etc. Wasn't sure if a format change would work but I figured I'd give it a shot. Nevertheless, same result.

Edit: I haven't figured it out yet but I've dimmed it down a bit. The file isn't found after saving but it's still there. During runtime of the uwp, if I went back to the menu and went to load, even when it doesn't read that there's a file, it's able to load my saved information. But when I restart the game, the save obviously isn't there.

To continue on this, during the test runtime through gamemaker, it is able to read the file, but during the uwp runtime, it's not able to. So it seems to be storing my information temporarily, as well as staying hidden, inside the uwp runtime. Hopefully, this helps narrow the issue down
 
Last edited:
Top