filelist from a folder

This forum is currently in read-only mode.
0 favourites
  • Is it possible to list files with certain extension from selected folder?

    Example: open *.aaa from c:\folder and list them in text object in a game.

  • yes it's possible.

  • Great, how?

  • If it's possible why You don't want to tell me how?

  • If you have any of the .99 versions check in the program's folder for the z map editor.

    The included cap will have all the info to figure it out.

  • I have 0.99.5

    I can't find (in the program's folder) z map editor. Only cap file is in the tools\mesh editor\mesh editor.

  • I have 0.99.5

    I can't find (in the program's folder) z map editor. Only cap file is in the tools\mesh editor\mesh editor.

    There is an example of what you want to do in the Mesh Editor .cap.

    It's in the group buttons & the load and save part, it uses the common dialog object.

  • When I want to open file I have to pop up typical "open file window".

    I'd rather list files with certain extension from selected folder inside a game as text object.

  • Kind of like this?

    List files with extension

    Put the file extension your looking for in the text box, then click the button at the bottom to select a folder. Once you've selected one, the listbox will be populated with all files with the specified extension. Of course, you don't have to use the folder selector, you could just use a preset folder, but this is just to get the idea across.

    Hope this helps.

  • Thanks a lot!

    That's what i was looking for.

  • I have another problem with listing files from a folder.

    I have 6 files in example folder: file1, file2, file3, file4, file5 and file6

    I'd like to list only 3 of them (becaluse player has to complete them first in order to reveal rest). So the list should fool like this:

    file1
    file2
    file3
    ---
    ---
    ---
    [/code:1im6tcb1]
    
    Could You modify your example to work like this?
    
    (I've tried to change event "for each file in XXX" to "repeat 3 times" but it doesn't select files properly.)
  • Its been a while since I tried to work on the program I needed this for but thought I'd ask before going back to it, anyone know of a way to tell if its a folder instead of a file? I wanted the program to be able to list files, go inside of folders and list those as well.

    This just came to me as I was typing...

    I could use the If Folder Exists -> Change Directory and iterate through all the files listed to check them.

    But does anyone know of a quicker way...say if a folder actually has an extension?

  • I just used a modified version of the example I provided a while back to do what you want:

    Limit Files Shown Thingy

    It's a fairly simple change. Hope this helps.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've just looked into it. It's a different example...

    In this one mouse cursor is placed on randomly selected square.

  • Whoops, sorry about that. I've edited the post to have the proper link.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)