Can't change last column (y) in my array

0 favourites
  • 3 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I've been running into lots of strange bugs today, and I'm quick to blame C2, but in the end ALL of them have been stupid errors on my part.

    That said, I'm completely stumped by my current problem and I could really use some help. I'm sure I'm just doing something wrong but I have no idea what it might be and I've been working on the problem for HOURS.

    My array has the dimensions 468,3,1 and I'm simply trying to change the first value in the last "column".

    Set value at (card_count,last_column) to my_rnd[/code:362kg8fk]
    To make sure I wasn't having an issue with my variables I simplified the code above to:
    [code:362kg8fk]Set value at (1,0) to 300[/code:362kg8fk]
    I ran my app and watched the array in the debugger. The first value changed to "300", as expected. Then I tried (1,1).  The second value changed.  (1,2) caused the third value to change. But (1,3) has ZERO effect.
    In desperation I tried setting the value to str(300), but that didn't work either.
    What on earth am I doing wrong?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Indices start at 0, so you can only index 0,1,2 for an array with a size of 3.

  • That did the trick! Thank you SOOO much. It's sort of obvious now, but I sure wasn't getting it on my own. (It's late here so maybe I'm just tired...)

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