Rob
Member
Using GMroffessional, no tag for it that I can find.
Hello, I have a bug I can't seem to fix. The array is initialised properly and only recently, the last few days there is this fatal error.
The bug I can't fix is as follows:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_slime_farm:
trying to index a variable which is not an array
at gml_Object_obj_slime_farm_DrawEvent_1 (line 8) - if global.a_stats_pl[0, 48] >= global.a_stats_pl[0, 49]{
############################################################################################
global.a_stats_pl is defined in obj_stats create event which initialises all the games arrays.
Initialisation of arrays looks like this:
global.a_stats_pl[0, 1] = 10;
global.a_stats_pl[0, 2] = 50;
and sometimes this:
for (var t = 0; t < 99; t += 1){
global.a_array[0, t] = -1;
}
These are the only ways i'm setting up arrays and the only time I've had a similar error before is if i've made a typing mistake. I've checked obj_stats as well as the code where the error appears, copy pasted etc and still haven't fixed the bug.
Any pointers as to where I could look or what might be causing the issue would be greatly appreciated.
Thank you.
PS Attached some screenshots if it helps.
Hello, I have a bug I can't seem to fix. The array is initialised properly and only recently, the last few days there is this fatal error.
The bug I can't fix is as follows:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_slime_farm:
trying to index a variable which is not an array
at gml_Object_obj_slime_farm_DrawEvent_1 (line 8) - if global.a_stats_pl[0, 48] >= global.a_stats_pl[0, 49]{
############################################################################################
global.a_stats_pl is defined in obj_stats create event which initialises all the games arrays.
Initialisation of arrays looks like this:
global.a_stats_pl[0, 1] = 10;
global.a_stats_pl[0, 2] = 50;
and sometimes this:
for (var t = 0; t < 99; t += 1){
global.a_array[0, t] = -1;
}
These are the only ways i'm setting up arrays and the only time I've had a similar error before is if i've made a typing mistake. I've checked obj_stats as well as the code where the error appears, copy pasted etc and still haven't fixed the bug.
Any pointers as to where I could look or what might be causing the issue would be greatly appreciated.
Thank you.
PS Attached some screenshots if it helps.
Attachments
-
26.8 KB Views: 34
-
114.6 KB Views: 34
Last edited: