Hi, so I'm working on an ASCII game in GM and I'm setting it up so that users can use Notepad to create additional levels. So far it's worked pretty well, but I'm having trouble putting together a level select list in the game. What I'm trying to do is "scan" the Levels folder in the game directory to find out how many level files are in there, and then assign each file a place on an array. The array part will be easy, but I can't seem to "scan" the folder; when I debug the method I'm using, I just keep getting "0" files back. Here's my code:
levels = 0;
level_array[0] = file_find_first('working_directory*\Levels
\level_****.txt',fa_readonly);
while(file_find_next() != ""){
levels += 1;
}
file_find_close();
I'm a little unsure about the part of the function where I used "fa_readonly," and the GM help file is pretty confusing when it comes to some of these file functions; the other options seemed worse. If you're not familiar with these functions though, I would recommend checking out the GM help file and see what you can make of it.
Thanks!