• 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 Read a file from another game?

N

natahem

Guest
Does anyone knows if it's possible to read an ini file from another game? I'm trying, from "Game2", to access a save file from "Game1".
I did something like:
dir = environment_get_variable("LOCALAPPDATA");
if (file_exists(dir+"\Game1\"+"Save.sav")) {
check=true;
}

But it doesnt work.
I also tried with a path like:
dir = working_directory + "..\Game1\"
But the path is not working either.

So the question is, how to access a file not located in the current game directory?

And in a similar way, is it possible to read Steam achievements from another game?
(the idea being to give bonus to players who finished previous games....)
 
GMS is sandboxed, meaning it cannot load or save files outside of its own game folder, unless you get permission from the user. (On Windows platform, there is a function to prompt the user to select a file, GMS can then access that file)

Check the doc under "File System Limits" for more info.

I believe there is a market place extension which may let you access files outside the sandbox.
 

klys

Member
Not all file system functions are sandboxed.

But you can use online features to do that feature you want.
 
Top