1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Map List

Discussion in 'Modding Help' started by Monkey_Feats, Jul 4, 2017.

  1. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    Hey, I'm want to make an array of all the maps in the Maps/ folder.
    currently I am using this, but it doesn't return any files that are in the sub folders.
    Untitled.png
    Is there a way to iterate through Maps/ and it's sub folders or do I have to iterate the separate folder paths?
     
  2. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Uh you're searching for matches to "Maps/.png" - the plus concatenates those 2 strings beforehand, they aren't separate arguments. Just "Maps/" might work (not sure, been a while), but if not you might indeed need to know the directories in advance I'm afraid. Could have a config file to specify them to future proof it I guess?
     
  3. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    Oh right, seems weird it returns anything at all then XD. "Maps/" just does the same but returns any other files too. All good.
    While you're triggered, is there a way to reload a file on the fly? I want to save the current map to a png (cached image) and then load that png as a preview image for an actual savemap.
     
  4. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    The .png soft-matches anything with a png extension.

    I don't think images on disk reload on the fly but you could render it out to a script texture. If specifying those for GUI rendering isn't implemented yet (can't remember if I got time for that) I could add it (and in the meantime you could add a special-purpose blob that just displays that texture and positions itself in screen space).