Page 1 of 1

file scanner?

PostPosted: Tue Jan 18, 2011 9:26 pm
by Fojam
could we possibly add a feature to GE that would scan a specified directory for dat files, list them, and then let you decide which one to load?

Re: file scanner?

PostPosted: Tue Jan 18, 2011 9:27 pm
by Game A Gogo
You'd need to do this manually, which is a bit advanced

Re: file scanner?

PostPosted: Tue Jan 18, 2011 10:29 pm
by Fojam
could you pm me a tutorial?

Re: file scanner?

PostPosted: Wed Jan 19, 2011 2:11 am
by Game A Gogo
I'm sorry I don't dispose enough time at the moment ): but I will get to it when I can!
But this method would consist of loading a specific name, and somewhere add numbers for exemple if you wanted all files: "Level##.lvl", I could make it load from Level00.lvl until it reaches Level99.lvl or the end of the set.

Re: file scanner?

PostPosted: Wed Jan 19, 2011 6:11 pm
by Game A Gogo
you need to create a variable this could be "LevelN" for holding which level
then when you want to load the next level, do this:
Code: Select all
char* tstring;
sprintf(tstring,"Level%02d.lvl",LevelN);
LoadGame(tstring);


I know that's probably not what you wanted, but you can know when there are no more Level##.lvl files with fopen

Unfortunatly, you can't just search through directorys and get every filenames, this is the closest maybe.
Of course, makslane marks evert feature request so don't worry :)

Re: file scanner?

PostPosted: Wed Jan 19, 2011 9:43 pm
by Fojam
alright ill do your method for now. thanks!