htmlarraysalgorithmif-statementconstruct-2

Check value of array in Construct 2


In my mind I want to do this:

If (my button is clicked)
    if(q_shuffled_arr_easy[0][5]) == 0)
        // do X
    else
        // do Y

For that reason I have structured my event sheet like this:

enter image description here

However, it doesn't work like I would like to, since q_shuffled_arr_easy[0][5] is not 0 when the button is clicked (its value is read on start of the layout and the debugger proves it's not 0), but it does X and not Y as intended. How to achieve my goal?

enter image description here

I've posted a more texty question in Construct's 2 Forum.


Edit:

I also tried to compare with str(0) instead of 0, but still the same behavior! Same with int().


Solution

  • I had to fill the array with:

    Value: int(valueToInsert)

    Then there is no need to specify a conversion when comparing.