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

Discussion and feedback on Construct 2

Post » Sun Jan 17, 2016 2:12 am

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".

Code: Select all
Set value at (card_count,last_column) to my_rnd


To make sure I wasn't having an issue with my variables I simplified the code above to:

Code: Select all
Set value at (1,0) to 300


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?
B
11
S
3
Posts: 85
Reputation: 866

Post » Sun Jan 17, 2016 2:26 am

Indices start at 0, so you can only index 0,1,2 for an array with a size of 3.
ImageImageImage
B
71
S
22
G
259
Posts: 3,793
Reputation: 143,702

Post » Sun Jan 17, 2016 2:59 am

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...)
B
11
S
3
Posts: 85
Reputation: 866


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests