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

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?
 
H

Homunculus

Guest
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!
 
H

Homunculus

Guest
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 by a moderator:

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