Phil Strahl
Member
So I have a directory with .png files and corresponding .json files. If I add them to my "included files" everything is peachy and accessing them with working_directory etc. works just fine. However, I would like to load and add them at runtime instead, because
Here's my problem in practice:
The files I added manually into my project to look like this:
Upon loading my test-game, this code runs:
The output is, not surprisingly:
BUT:
If I compile the game to a zip, then unzip it somewhere and copy a bunch of additional .png-files into the "sprites" directory, the output still remains
while it should be
I suspect this having to do with the fact of the game running in sand-boxed mode, and I wonder if there's a way around this without having the user each time give the game access to a folder via get_open_filename...
Hope I got my problem across and that any of you know a solution, if there's any.
UPDATE: Even stranger: I substituded working_directory with program_directory and it kinda worked ... in that if I changed the files to some other files with different filenames, those were found. Although never more than 2, the amount of files I have in the "Included Files" bin in GM:
- I want to be able to change and pop new files in without having to re-compile the whole project again and update the binaries.
- there are *a lot* of files and adding them manually in GM would take me ages.
Here's my problem in practice:
The files I added manually into my project to look like this:
Code:
+ Included Files
+ sprites
+ spr_test_1.png
+ spr_test_2.png
Code:
var dir = working_directory + "sprites\";
var file = file_find_first(dir+"*.*", 0)
show_message(file); // debug output
do
{
file = file_find_next();
show_message(file);
}until (!file)
Code:
spr_test_1.png
spr_test_2.png
If I compile the game to a zip, then unzip it somewhere and copy a bunch of additional .png-files into the "sprites" directory, the output still remains
Code:
spr_test_1.png
spr_test_2.png
Code:
spr_test_1.png
spr_test_2.png
spr_test_3.png
spr_test_4.png
... etc ...
Hope I got my problem across and that any of you know a solution, if there's any.
UPDATE: Even stranger: I substituded working_directory with program_directory and it kinda worked ... in that if I changed the files to some other files with different filenames, those were found. Although never more than 2, the amount of files I have in the "Included Files" bin in GM:
Last edited: