It seems that I have not understood the laying of conditions from Construct 3 blocks yet. I thought it was something like JavaScript, but in Construct 3 things are incomprehensible to me.

Therefore, I am asking for an explanation of what is wrong in my thinking.

I have this code:

The speakOneDirection function is running.

One parameter is passed with the value 0, i.e. the function should start speech synthesis.

It should because the array "arr_potential_directions" on position 0 is written as 1:

Meanwhile, the function works the other way around.

The function does not start speech synthesis. The function will only work only if I write in the condition:

Value at arr_potential_directions.At(arrayPosition) = 0

And yet at position 0 in the array is saved 1!

These are some miracles that even the oldest inhabitants of my village have not seen ;-)

The value at arr_potential_directions.At(arrayPosition) is 1, so youre saying if the value at 1 is 1. You needed simply value at arrayposition = 1 , not arr_potential_directions.at(arrayPosition) = 1.

I'll attempt to explain it better but it can be a little confusing even then :D

You are using the condition compare at X of the array, so you're checking that a value at position X is = to some value.

So the condition would normally be, compare at position 0 = 1, that's what you're trying to achieve.

Instead you are passing a parameter through a function which is fine so its compare at position param = 0, so youre comparing if position 0 = 1.

However in your events, instead of using a 0, or the parameter, you've used array.at(param) which is a value in the array.

So you are saying if at POSITION : array.at(0) is equal to VALUE 1.

array.at(0) is the value at X=0 which is 1.

So it becomes a comparison, if X=1 is equal to 1 because you've replaced the position you want which is 0, with the value AT 0 in the array.

Look at the condition without the function, you are comparing a POSITION is such a VALUE. You replaced what would normally be a 0, with a parameter 0. Which was my correction, it should just be arrayposition = 0. You've gone one step further inception style and said if the value at position(position(0)) in the array) so if the value at position(1) is 1, if X=1 is 1.

array.at(x) is looking into the array for a value. It's confusing but think about it...

Another way to look at it : Value at ( Value at array=0 ) = 1 becomes Value at 1 = 1. It should just be Value at (0) = 1 or Value at (param) = 1.

If this doesn't get through I'm not sure what else to suggest. It should click after reading that I hope.

I gave you the fix already, just thought we were trying to get you to understand it. The fix is replace : 'array.at(param)' in the first box with 'param'. The condition you are using, the X position acts as like saying array.at so you don't need to use it again. I don't know how else to explain it.

I think if you do want to write it in the format you have now you could use system compare 2 values haha.