• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows [solved] Can't save to working_directory after compile (Steam API)

C

CassCornelian

Guest
When I run my project in the IDE with a windows compile target, my .INI files are (rightly!) saved in "/AppData/Local/<game name>". Everything is normal; the sandbox is where it should be.

But when I compile the application and run it [outside of Game Maker Studio], it read/writes directly from/to the parent directory ("/AppData/Local/").

I'm not sure if my GMS version has changed since this started happening, but this wasn't happening before.

Is there a chance I've broken something in configuration somewhere or is this a bug? Can anyone suggest a solution or workaround?

EDIT: Important new clue! This behavior only occurs when exporting with the Steam API enabled.
 
Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Are you using the stand-alone EXE as a distribution method? If so then that's probably why this is happening... you really should either use the Zip or Installer packages...
 

Bingdom

Googledom
Are you using (working_directory + "\Save.ini")?

Everything is normal; the sandbox is where it should be.
It seems like you misunderstand the term 'sandbox'
What game maker means by 'sandboxed' is that game maker can be exported to multiple platforms, (you are free to export what you desire, hence sandbox).
When exporting to android, there is no /Appdata/ folder, and you can only access certain areas. While Windows you can save your file anywhere, as long as you have admin privileges. That's what it means by saving limitations.
 
C

CassCornelian

Guest
Are you using the stand-alone EXE as a distribution method? If so then that's probably why this is happening... you really should either use the Zip or Installer packages...
It's a zip. I was just trying to be concise. This is occurring either way! :(

Are you using (working_directory + "\Save.ini")?
Nope! I'll try this.

It seems like you misunderstand the term 'sandbox'
What game maker means by 'sandboxed' is that game maker can be exported to multiple platforms, (you are free to export what you desire, hence sandbox).
When exporting to android, there is no /Appdata/ folder, and you can only access certain areas. While Windows you can save your file anywhere, as long as you have admin privileges. That's what it means by saving limitations.
Actually, I believe "sandboxed" refers to the fact that any reading/writing is isolated from the file system (and parent directories) without explicit permission at runtime. (In the 'sandbox', you're free to play around without causing any serious trouble.) My usage of the term was consistent with how it's used in the GMS manual. But maybe "working directory" is the better term.

Regardless, the real issue here is not that I am reading/writing outside of the expected working directory. The issue is that the working directory is changing after compile. This is not how the compiler was working 2-3 months ago.

But, yes. I'll try explicitly including working_directory to see if this fixes the asymmetry.
 
C

CassCornelian

Guest
I tried using something like ini_open("game_name\save.ini") as a workaround. Running in IDE now saves to \appdata\local\game_name\game_name\.

I expected the exported version to save to \appdata\local\game_name\, but it didn't. Surprisingly, it seems to have saved to \appdata\local\ just like before.

Could this be some kind of permission issue?

Edit: I disabled the Steam API and it stopped. I'm able to save inside the "game_name" directory again. Looking for configuration issues now, but I'm at a loss.

Anyone got any ideas?

Final Edit: The issue has been resolved.

Game Maker: Studio was behaving flawlessly.

It was a configuration issue (steam API stuff outside of the IDE) leading to a permission error whenever I tried to access the application's sub-directory.
 
Last edited by a moderator:
Top