I don't know if this is a bug, or just my lack of programming knowledge. I created as simple a capx as I could the illustrate the problem.
On program start, I define two arrays.
box - (x,y,z)
x = statistics for box ie, maxHP, atk, def, etc,
y = boxes lvl, ie, 1, 2, 3, etc
z = which box, ie, red or orange
curVar - (x,y)
x = cur variables held, curHP, curLVL, curName, etc
y = which box, ie, red or orange
In my code, I use positions in the curVar array to call position in the statistics array,
"HP: " & curvar_array.At(3,menu_box.box)& "/" & box_array.At(1,curvar_array.At(2,menu_box.box),menu_box.box)
"HP: " & curvar_array.At(3,select_box)& "/" & box_array.At(1,curvar_array.At(2,select_box),select_box)
Example A calls from the instance variable set on the text box to display the info in the array.
Example B calls from a global variable - select_box, which is defined based on where one clicks - to display the info in the array.
Example A works fine, but Example B breaks the code.
If the global variable - select_box - is set to 0, the code breaks even though I define the array at (0,0,0), but if on start of layout I set select_box to 999, the code works fine.
The error message I get is:
"THE PAGE AT THE LOCALHOST: 50000 SAYS:"
Uncaught TypeError; Cannot read property "0" of undefined
http://localhost:5000/Arr_pluging.js, line 102
This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report in to the developer!"
Here is the capx for reference:
Thanks for taking a look at this