• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Problems With Saving & Loading .ini Files

B

Ben Hubble

Guest
Hello, right now i'm making achievements for my top down shooter. I'm doing this by storing all the achievements and if they have been completed in an ini file called achievements.ini. However, when I created the ini file in the same folder as my project and tried to open it in game, it said the ini file didn't exist (I used the show_debug_message & file_exists functions for that). Any ideas on what is going on?
 
E

elementbound

Guest
GMS uses a sandboxed filesystem, so if you open e.g. "foo.ini", it won't look in the project's directory. Add your ini file as an included file, and then you can use it.
 
B

Ben Hubble

Guest
GMS uses a sandboxed filesystem, so if you open e.g. "foo.ini", it won't look in the project's directory. Add your ini file as an included file, and then you can use it.
Thank you for the help!

I'm making a login system using ini files (no idea if that's a good or horrible idea), and it works, I registered and I am able to log in, but when I go back into my project and go into my ini file (manually) it shows that it doesn't change. However, my game shows that it does change as I was able to change my username and password (Which is stored in my ini file). Is this something I just have to deal with or is there a solution to this?
 
Last edited by a moderator:
the file needs to be in a special folder in your game file, just dropping it anywhere wont due.

try creating the ini and then rightclick on included files in the drop down on the left hand side of gms, add existing file and then select it, that should drag it to the correct location.

also make sure you close it when not being changed because if its open when you try to start a level the game will use the last saved copy and not the one with all the changes thats open on the desktop but not saved.

more information would be really helpful...

thank you.
 
L

lovareth

Guest
if you're just testing your game using green play button, the .ini files created at "C:\Users\$username$\AppData\Local\$gamename$" (windows os). if you're testing your game by creating an .exe, try creating a zip version so the ini will created inside that folder (if im not mistaken). and you maybe want to read and use this working_directory
 
Top