Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 13/02/2008 15:08:30

Title: File loading window
Post by: on Wed 13/02/2008 15:08:30
I'm currently working on a little puzzle game.

The map of every level is stored in 'dat' files. Currently there are 5 of them (1.dat, 2.dat ... 5.dat).

My desire is to let other people design their levels. My plan was to:

1 -write a function that would have scanned the folder in which the game was played in search for .dat file
2 -display them on a GUI
3 -let the player pick the one they prefer

Read the big M., did a fora search, could not pass through step one.

So my question is:

Is there a way to accomplish that? Do you think there is another method to make 3rd party leves possible in a AGS game?

Thank you in advande
Title: Re: File loading window
Post by: GarageGothic on Wed 13/02/2008 15:13:47
You'll want to look into the ListBox.FillDirList(string filemask) function.
In your case you would set up a listbox and do something like lstFileToLoad.FillDirList("*.dat");
Title: Re: File loading window
Post by: on Wed 13/02/2008 18:36:56
Quote from: GarageGothic on Wed 13/02/2008 15:13:47
You'll want to look into [...]

I'll sure want to. Thanks!
Title: Re: File loading window
Post by: Khris on Thu 14/02/2008 01:24:31
If you want a bit more control, iterate through the possible file names and try to open them using File.Open. The returned pointer to the File will equal null if it doesn't exist.