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

 Please allow program directory to save and write data

S

Shadowblitz16

Guest
@Mike please can you allow program_directory to support both saving and loading?

it wouldn't get rid of sandboxing but would allow the user to have portable game data.

this would still keep people from saving to locations that could be harmful but it would also allow better modding support for gms games.

it could be for desktop only if needed but I don't think this restriction is fair
 
I'm pretty sure you need admin rights to modify the program directory folder.

If I remember correctly it's bad practise to allow write access to that folder, because it can mess up the application and or make it a target for viruses etc...

I would be surprised if they would allow it, but I think there are extensions on the market place that can break out if the sandbox if you didn't know already.
 

Mike

nobody important
GMC Elder
Saving to places like Progam files (where games would normally be installed) needs admin rights, and so won't happen.

GameMaker automatically Loads and saves to the most appropriate place on all machines.
On PC, loading will usually come from Program Files (or where ever they've installed to), and then load from %localappdata% as this is where user data (per machine login) usually comes from.
On devices like Android things are more complex, as games are loaded from a "ZIP" and then saved to another special area.
Consoles get even complex...

Sorry. The current behaviour is there for a reason, without it too many folk try to load/save from/to "c:\" and then expect that to work on everything. There are extensions if you wist to handle it yourself.
 
S

Shadowblitz16

Guest
@Mike it may need admin rights to save on windows in program files but to a portable folder out side of it it does not.

I don't see why admin rights is a big deal anyway? just have warning about it in the gm docs about it only being for desktop.
you have done that before.

@IndianaBones I don't see how it could allow people to make viruses. it would be contained in the program directory and if necessary a data folder that could be renamed.

aka program directory not being program files but the folder of the game!

@The-any-Key I don't want to have to buy a extension when there is no reason in the first place that this is not allowed.
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
Sorry. The current behaviour is there for a reason, without it too many folk try to load/save from/to "c:\" and then expect that to work on everything. There are extensions if you wist to handle it yourself.
Sorry, but I just don't buy this preemptive assumption of ignorance in developers who use GM.

Just so that I don't have to reinvent my own wheel, here is a post I've made last year arguing against your point:
The sandbox needs to be gotten rid of or at least made optional/configurable, precisely because you don't know where all the possible load and save points are. You shut out perfectly valid load and save points and add needless extension dev work for GMS users. None of GMS's competitors do this.

Let's take Windows as an example. Here are a number of valid load and save points that the Sandbox won't allow:
  • Saved Games (under home directory)
  • Another directory in %localappdata% or %appdata% not exactly equal to the project's name (e.g. multiple games belonging to the same company or series sharing data with each other)
  • My Pictures (under home directory)
  • Files passed in through the command line for opening
There are use cases for all of these. We've opened tickets on Mantis about all of these. No action for 4 years.

What about Android or iOS?
  • The photo gallery
  • Camera pictures (DCIM)
  • File paths returned by file selector extensions
All of GMS's competitors allow access to these as long as you set the right permissions and go to the right place. GMS alone makes its users jump hoops and write proprietary extensions, just because its creators fear novice ignorance even when non-novices are using it.

If you insist on a sandbox, I suggest adding the following functions:
  • file_sandbox_allow(path): Adds the specified path to the sandbox's whitelist. Will throw an error if it is inaccessible.
  • file_sandbox_deny(path): Removes the specified path from the sandbox's whitelist.
If anyone makes the mistake in your example or anything along that line, the error message along with the name of the export + OS version would make the problem trivial to resolve.

Let people who are novices play within the sandbox. Let people who aren't break out of it as needed.
Please, consider the tickets that have already been made about widening the sandbox, and consider ways to reprogram the sandbox without extensions. It's the least you could do to improve the most historically hated feature of GMS, especially with GMS 2.x trying to grow its professional audience. Virtually every extension for working around the sandbox expresses derision and contempt of the sandbox in their title, that should tell you something.

If you want GMS to be taken seriously as a non-infantile tool for game development, perhaps the first place to start is to stop preemptively treating its users as infants. You are the only one on the YoYo team that asserts the sandbox's treatment of GM developers this aggressively.
 

stigmund77

Member
I agree, in my opinion keeping functions dumbed down like the sandbox filesystem because you believe the people who use your software are not smart enough to handle filesystem access places game maker one step away from being a professional game making tool.
 

Mike

nobody important
GMC Elder
Sorry, but I just don't buy this preemptive assumption of ignorance in developers who use GM.
Just so that I don't have to reinvent my own wheel, here is a post I've made last year arguing against your point:
Just because you don't agree, doesn't mean it's not totally valid. The ability of GM users covers the whole spectrum, but there are far more novices and those towards the lower end than experienced coders. You may not like it, but it's true. This is there because we've had to deal with this in the past - many times (in GM 8.x and early GMS1.x days), and this forces these users to do it in a way that is portable. If you're an experienced coder, it's not a hard thing to get around.
It's the same reason that registry stuff was removed. Not only was it totally incompatible with cross platform development - as is the file system, it was abused but those who didn't really understand what they were doing.

It's the least you could do to improve the most historically hated feature of GMS, especially with GMS 2.x trying to grow its professional audience.
Rubbish, it's funny how the "most hated feature" is usually what someone themselves doesn't like.. Professional coders - especially those who move to consoles, will use the system as is, precisely because it IS so portable. If you're going from windows to Linux, to Mac to Android to XBox... you don't want to have to handle this stuff yourself, it's a nightmare that you just don't want to have to deal with.

As I say, you may not agree, but there are reasons behind it that we're firm believers in, and that help preserve the cross platform nature of the tool. At the end of the day, if you don't like this and if you want to bypass it, then as an experienced user, you can easily use an extension to do whatever you want. There's plenty on the Marketplace....

Lastly... having GML functions adding to the white list is a joke. Whats to stop anyone adding c:\ or c:\window, that's basically the same as removing it all. The END USER is the only one who should be allowed to add to the whitelist, to "let" a game/app save somewhere on his machine.
 
S

Shadowblitz16

Guest
@Mike
just check if the program_directory is in "C:\Program Files" or if the system is not desktop.
if it is then reroute writing to the working_directory.
problem solved.

you can still implement the ability to write to program_directory if its not.
 
I

icuurd12b42

Guest
Plus, Win10 apps cant even be accessed by the admin, me. The folder where apps are located is totally locked! Welcome to the future....
 
Top