Array building

This forum is currently in read-only mode.
From the Asset Store
Buildings - Isometric view - PNG transparent - multi styles, multi fonctions buildings
  • Has anyone at any point created a Construct app for building arrays more easily, or extracting arrays from text files?

    I've got to build 16+ 10x10 arrays (or possibly a 10x10x16 array, whichever is easier) made up of nothing but A04AB2A1A3B0D1CAC2 and so on (tiled level data). I could make an INI instead but it would be freely editable and take forever to fill in the data. In essence, I could brute force write it but it would take days.

    Or is there already a more straightforward way to do this in Construct that I am missing?

    NB: I did attempt to search for this but the forum search yielded little results and another search caused the search engine to fold its arms and glare at me until I went away.

  • What keeps you from using the built-in "Load from file"/"Save to file" actions of arrays/ hash tables?

  • ...that's not quite the problem.

    I need to easily and smoothly construct 16 arrays with 100 characters in each one, in a way that is faster than manually telling Construct to put the values into the array using events.

    As in just inputting them into a Construct app or simpler text file than an INI and have Construct read the characters into an array.

    Load from file doesn't seem to act as I expect it to unless the array already exists, and so I'm not sure how to use it properly.

  • I have used arrays quite a bit, but I have to admit that I'm not sure what it is that you're trying to achieve.

    I've got to build 16+ 10x10 arrays (or possibly a 10x10x16 array, whichever is easier) made up of nothing but A04AB2A1A3B0D1CAC2 and so on (tiled level data). I could make an INI instead but it would be freely editable and take forever to fill in the data. In essence, I could brute force write it but it would take days.

    So where does this data "A04AB2A1A3B0D1CAC2" actually come from?

    Of course you can load strings into an array from a plain text file. I was just sitting here working on an example that involves something like that:

    http://dl.dropbox.com/u/2306601/gettokenthing06.cap

    Think of the text object SourceText as the text file. The Size of the array is determined by the source text and the different values/strings are put into the array using delimiters. I just had a vague hunch that this could be interesting for you.

    Other than that you'll have to explain the problem further for people like me to get it.

  • That's basically what I wanted to do:

    Extract a bunch of information from either a text file or some other means, into an array.

    I just didn't know whether there was a simpler way to do it than manually telling Construct to set each array value.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's basically what I wanted to do:

    Extract a bunch of information from either a text file or some other means, into an array.

    I just didn't know whether there was a simpler way to do it than manually telling Construct to set each array value.

    So it wasn't completely improper to post this wip example?!?! I'm glad.

    You'll find yourself using For each element and loops in general a lot when working with arrays. At least that's what I do. Good luck with your project(s)!

  • So, I'm back.

    I decided after much fiddling that building a Construct app that can easily write and read arrays would ultimately be useful not only to me, but maybe to other people. Besides, that just means only people who bothered to read this thread can tool with arrays.

    However, I need a bit of help. The writing arrays I think I have down, thanks to PixelRebirth's example, but I think I am not fully understanding how Construct does FOR loops, as my for loop seems to refuse to repeat more than once. I think I may be using the wrong identifiers with the array calls as well...

    Anyway, any input would be appreciated. Sorry about the .ymt addition for the filenames, it was originally designed for making levels for my game. It can easily be chopped out of the code, and will be if I actually get this thingy done.

    http://www.megaupload.com/?d=77WMEPKZ

  • I was just now able to download your cap, since Megaupload told me before the file wasn't available for some reason.

    So I didn't really look into your cap so far I'm afraid. Won't you include the Z dimension of the array in your app? Anyway, will give you more feedback soon.

  • No problem.

    Again, it was originally just X and Y for my game, but if I can actually make this thing work I could definitely think of other features... filetypes, Z, etc.

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