How do I Set a Local Variable to an Array Value?

Get help using Construct 2

Post » Sun Jul 20, 2014 5:05 pm

I have the code set up like this:
Set EnAttackID to EnemyProp.At(EnemyIndex, 3, EnemyProp.At(EnemyIndex, 7, Phase))
The debugger tells me at the moment this happens, EnemyIndex is 0 and Phase is 0. The value at 0,7,0 in EnemyProp is 0 and the value at 0,3,0 is 0. But the debugger shows this value setting to null. I even tried just using EnemyProp.At(0,3,0) but it still went null. Only when I put Set EnAttack ID to 0 did it actually work. Why is this happening?
EnAttackID, EnemyIndex, and Phase are all local variables and do have the proper scope for this function.
B
5
S
1
Posts: 31
Reputation: 439

Post » Sun Jul 20, 2014 5:15 pm

What are the size settings for the array?

my first guess would be it only has x and y and no z..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 20, 2014 5:21 pm

Width 100, Length 20, Depth 10. I checked to make sure array size wasn't the issue.
B
5
S
1
Posts: 31
Reputation: 439


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests