• 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 problems with file_find_next() and sandboxing

R

rinkuhero

Guest
when using a while loop and file_find_next() and the working_directory to make a list of files in a directory, what i expect would happen, due to gm: studio's sandboxing, is that it would make a list of both possible working_directory locations (the "save folder" and the "program bundle"), and that file_find_next() would cycle through both directories.

what i'm using that for is custom levels that are included with the game, which are stored in the 'program bundle' (install directory) in [game's install directory]/data/custom/, and the custom levels that a player themselves make, which are stored in users/username/appdata/local/idefense/data/custom. both of those should be equivalent to working_directory/data/custom, and i see the files are correct in both, i just can't seem to read through the former using file_find_next() to get a list of its contents.

so basically, my issue is, it should be possible to make a list of the complete contents of both of those directories using file_find_next() on the working_directory, so that i could find all of the levels that are both included with the game, and created by the player, but, what's happening is, file_find_next() seems to only check the program bundle files, not the appdata files / save folder.

is this a bug? because i seem to recall file_find_next() working on both in the past with my game, but lately, it doesn't seem to detect anything saved in the save area, only the program bundle area. is there any way to fix this?

(this is for my game on steam, immortal defense, which now no longer is able to detect the existence of custom levels that user creates and saves in the save directory, when it used to work fine with the same code, around 2016. the only thing that changed is an update to newer version of gm studio, currently v1.4.1763)
 
Top