Array editor problem.

From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I already seem to have dyslexia when it comes to C3 arrays. I have no problem with them in other languages, but they just seem painful in C3. Anyway, I typed in my values into the array editor, made an array of the exact same dimensions and loaded them in with Ajax, i.e 'Load from JSON string, AJAX.LastData'. I don't know why, but the x and y seem mixed up. I'm sure that's not true as somebody would have noticed and fixed it by now. But here are the images of my array in the editor and then in the debugger.

    I assume I'm just misunderstanding something about the way they're displayed. It just gives me a headache because I have to follow it through, line by line trying to work out whether it's checking columns or rows....

  • Yes, it's a bit confusing. In the editor axis X is horizontal. In debug X is vertical.

    By the way, you can rotate the array in editor. Right-click and select Transpose. I find it easier to enter data in rows, so I often rotate if back and forth.

  • Ahhh ok, well it's good to know that it wasn't just me being insane.

    And thanks, the transpose thing will help. At least I know what the array actually looks like now. Mind you, now I've transposed it, it's altered quite a bit, but hopefully if I can at least see how it's structured, that should line up with my code.

    I suppose the main point is, it looks like it looks in the debugger and not necessarily how it looks in the editor.

  • Mind you, it's still confusing and something seems to be wrong about the whole thing. For example, now that I've transposed it, yes, it looks in the debugger how it looked in the editor picture above... but now it says that it has 2 width and 11 height, even though the debugger window shows it as 11 width and 2 height....

    I think the only solution is to just run everything through the debugger and try every combination until it gets the right one...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the editor it's strange that the field to enter width and height are before the words "width/x" and "height/y", and always leads to initial confusion.

  • Even then, it feels completely broken to me. I'm running it step by step through the editor. Because I'm confused about which way it will load in the values, I'm having it load it both ways, into two variables, e.g loopindex,1 and 1, loopindex. Even though it runs 10 times, the values never change. The first seems to grab the value at 0,1 and then never change. This isn't right, because, if it's doing it 'correctly' (i.e the traditional way an array does things), then it would run across the values, e.g 442 then 532 then the word 'test', since I've added a new row to try to work out what's going on.

    The second value grabs 'DL', which is at 1,0. Again, this is 'right' on the first pass because I switched it over. But then it just stays the same, stuck on 'DL' for the rest of the loop. It should be running down the row, e.g DL, then DCL, then DCR, but it just doesn't move.

    I can't fathom this out at all, it seems completely broken or I'm doing something fundamentally wrong. It's odd because I've used arrays in dozens of languages, so I know how they work in my head. It's not just a case of C3 being backwards (which it probably isn't), but there must be something wrong in the debugger or in my code, because it's not giving any correct values out at all.

  • Oh my, I was about to post my code and as I was looking through it I noticed the problem.

    I had a loop called 'FLoop' but I was checking it with loopindex("Floop"). Yeah, they're not the same thing :p

    My bad, it's working now.... I think.

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