• 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!

Is there any way to read ini files from within the project folder?

Geners

Member
I have made two projects, one is the actual game, and one is an editor I made inside game maker that creates ini files that my actual game will use that contains a ton of data the game will need to access.

Is there any way I can move all these ini files I'm creating to the game project folder to be read by the game at runtime?

Right now I can only read from Appdata?
 

Homunculus

Member
You can only read and write to the sandbox unless you use get_open_filename / get_save_filename or disable the sandbox completely (you can only do that on windows, mac and linux platforms).
 

Geners

Member
You can only read and write to the sandbox unless you use get_open_filename / get_save_filename or disable the sandbox completely (you can only do that on windows, mac and linux platforms).
How do I disable the sandbox? Also will this conflict with anti-virus programs?

And then once I've disabled the sandbox how do I read from within my project folder?
 

Electros

Member
This looks like exactly what I need, however is there a way I can read from the included files with ini_read_real() and ini_open()?
I think so - can't remember the last time I used the function, but if the names align I think it should. Give it a test!
 

Homunculus

Member
Wait, is the editor just for development purposes, or is it something that will be used after the release of the actual game? In the first case, you will have all your ini files beforehand and @Electros solution (included files) is definitely the way to go. If instead you don't know when and where these files could be generated (because for example you distributed the editor to the players), included files will not help you.

ini_* functions will definitely work, and in fact they are meant to be used on included files (from the sandbox in general).
 
Last edited:

Geners

Member
Wait, is the editor just for development purposes, or is it something that will be used after the release of the actual game? In the first case, you will have all your ini files beforehand and @Electros solution (included files) is definitely the way to go. If instead you don't know when and where these files could be generated (because for example you distributed the editor to the players), included files will not help you.

ini_* functions will definitely work, and in fact they are meant to be used on included files (from the sandbox in general).
The first one. Will those included files be put in appdata so I can just call the file name without any pathing?
 
Top