Array saving/loading is messed up.

This forum is currently in read-only mode.
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • First, download all of these 3 files.

    http://www.mediafire.com/?29mcnco8wa2

    http://www.mediafire.com/?2xtnbmdcbvd

    http://www.mediafire.com/?0hotxqmmt2d

    In the first file array.txt, that's how I want the array to be. I wrote that in notepad. Loading this into Construct does not changes the array values.

    In the second file array2.txt, it's the result of Construct's array saving. What.

    The third file is the .cap I used for testing.

    What I ask is to change array loading to the one I want, because it's 1)simple, 2)clean, 3)easily modificable; I also want Construct to save arrays like that.

  • New problem :

    http://www.mediafire.com/?2jzxacv9uvz

    ^ ^ ^ In this .cap when debugging it and checking the array, I can only see the X values I choose, the Y values are not displayed.

  • New problem :

    You can't compare an array value.

    We need a condition :

    Compare array value at X,Y,Z

  • In the first file array.txt, that's how I want the array to be. I wrote that in notepad. Loading this into Construct does not changes the array values.

    That's because it's not a valid array file. The array object uses its own array files in a special binary format. This is absolutely necessary to store information such as the type of the data held in an element (string/float/integer), the dimensions of the array etc. etc.

    In the second file array2.txt, it's the result of Construct's array saving. What.

    An example of the binary format the Array object saves. It's not possible to manually write an array saved file in notepad.

    The third file is the .cap I used for testing.

    The first thing the file does is resize the array to a zero sized array. All dimensions must be 1 or more for there to be any elements. Do the multiplication: 3 x 3 x 0 = 0 elements! You probably meant 3 x 3 x 1. The array object ignores the set dimensions call because it doesnt allow you to create a zero sized array - I've changed this for 0.89 though, which will allow zero sized arrays (so you don't get confused with the wrong dimension sizes).

    In this .cap when debugging it and checking the array, I can only see the X values I choose

    Hmm, a limitation in the Array object's debugging. It's coded specifically only to show the first values on the X axis, ie. all values where Y = 0 and Z = 0. I did this because with a 100 x 100 x 100 array, you'd end up with the debugger spammed with a million entries which could be quite slow or hard to use. I'll try come up with something better.

    Compare array value at X,Y,Z

    Added for 0.89, woops!

    As for your array.txt file you want Construct to load: it's impossible to write a loader for this file! Should I interpret the first line as four numbers, 1, 1, 1, 1, or a single number, 1111? It's ambiguous and your way would be limited to single character values anyway, so this is the kind of thing you need a custom loader for.

  • I have an idea, why don't you code an external array creator?

  • Aah I'm just the guy who writes Construct. Someone else can if they think its important <img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" />

  • I could even code it but I don't know the parameters the array uses for saving/loading.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just make a save/loading app in Construct, using the array object <img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" />

    0.89 is released now and has the changes you wanted.

  • That would be well easy to make in construst <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" />

    If no-one can be bothered but its still in high demand I'll have a look at making one.

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