• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Windows I want to put the ini file in the same location as the exe file.

FoxyOfJungle

Kazan Games
Is it for settings? If it were, you could create a file manually and leave it in the "Included Files" folder, which will be exported in the same folder as the game.
You can try using the built in game_save_id variable and try to save using it (I know it shouldn't be used as a path, but it never hurts to try). But you will have to disable the sandbox in the game settings.
 
Is it for settings? If it were, you could create a file manually and leave it in the "Included Files" folder, which will be exported in the same folder as the game.
You can try using the built in game_save_id variable and try to save using it (I know it shouldn't be used as a path, but it never hurts to try). But you will have to disable the sandbox in the game settings.
I see, I understand. Thank you for answering my question!
 
But you will have to disable the sandbox in the game settings.
That option is very misleading. GMS2 is hard sandboxed and refuses to save to the program's directory and several other potentially protected directories even if the sandbox is disabled.
 

FoxyOfJungle

Kazan Games
That option is very misleading. GMS2 is hard sandboxed and refuses to save to the program's directory and several other potentially protected directories even if the sandbox is disabled.
Yes, I recommend using some Samuel Venable extensions.
The "File Manager" is very useful and works very well.
 

kburkhart84

Firehammer Games
That option is very misleading. GMS2 is hard sandboxed and refuses to save to the program's directory and several other potentially protected directories even if the sandbox is disabled.
I'm not sure if its GMS2 that isn't saving to those directories or if Windows is blocking it. I know if I try to directly copy a file to the program files folder I have to elevate to admin level to do it. This is similar to how you have to run notepad as an admin if you want to use it to modify the hosts file that is in the windows directory a few folders deep.

I DO know however that GMS2 will save to the datafiles folder inside the project folder. I'm using that to run a thing that saves input configuration system files in that folder so they then get added to builds. That won't work if the sandbox is turned on, so I know the setting functions at the least in a general sense.
 
I'm not sure if its GMS2 that isn't saving to those directories or if Windows is blocking it. I know if I try to directly copy a file to the program files folder I have to elevate to admin level to do it. This is similar to how you have to run notepad as an admin if you want to use it to modify the hosts file that is in the windows directory a few folders deep.

I DO know however that GMS2 will save to the datafiles folder inside the project folder. I'm using that to run a thing that saves input configuration system files in that folder so they then get added to builds. That won't work if the sandbox is turned on, so I know the setting functions at the least in a general sense.
It doesn't change with admin privileges. In that very post I quoted, you'll note YYG themselves said that GMS will never write to program_directory. It's an intended feature. Haven't tested writing to UAC-protected directories with admin privileges, so bundled those together just to be safe.

Yes, writing to datafiles works. GMS likely whitelists that folder since write access to files there is mandatory as that's where all your Included Files resources go. If you're using Included Files, those show up there as well, making it a suboptimal but still viable workaround.
 

kburkhart84

Firehammer Games
It doesn't change with admin privileges. In that very post I quoted, you'll note YYG themselves said that GMS will never write to program_directory. It's an intended feature. Haven't tested writing to UAC-protected directories with admin privileges, so bundled those together just to be safe.

Yes, writing to datafiles works. GMS likely whitelists that folder since write access to files there is mandatory as that's where all your Included Files resources go. If you're using Included Files, those show up there as well, making it a suboptimal but still viable workaround.
They should probably document that then. Or maybe they have and I just don't know about it. It doesn't surprise me though, in general you are not supposed to be writing to the program directory, you are supposed to be using the users folders, app folders, etc...

As far as datafiles...normally the executed builds would not need access to that folder. The contents of that folder get sent to the working_directory automatically. I'm referring to the actual datafiles folder in the project folder structure. You may already know that, but I want to be sure its understood what I'm getting at. And yes, if you leave the sandbox on, you cannot access that folder, because as far as a game build is concerned, its just another folder on the hard drive that is not part of the game(except that the working_directory happens to have the same contents).
 
Top