LEGOlars
Member
Hi.
I'm working on a large game and I just tried out the YYC instead of VM. Most things work perfectly, but I get this error:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Other Event: User Defined 15
for object objButtonListGraphicsQuick:
second index out of bounds request 0,6 maximum size is 1
############################################################################################
--------------------------------------------------------------------------------------------
called from - gml_Object_objButtonListGraphicsQuick_Other_25 (line 82)
called from - gml_Object_objMenuWidgetController_Other_13 (line 79)
called from - gml_Script_scrMenuLoad (line 169)
called from - gml_Object_objButtonSettingsGFX_Other_11 (line 4)
called from - gml_Object_objMenuWidgetController_Step_0 (line 166)
While trying to figure out what the problem is, I narrowed the code down to just this to reproduce the same error:
Ok so I guess one of the button_id's doesn't exist. Nope, I can run this code without getting an error:
Then I added show_message throughout the loop to figure out exactly where it crashes...
So it crashes inside the before reaching i=1, but the "button executes some code" works fine and it's confirmed that the button_id is an (existing) instance and the with(button_id i ) only executes for that single instance.
I'm absolutely clueless where to go from here. This piece of code works fine as well when building with VM. And I did clear the cache multiple times before building with YYC.
Anyone experienced something similar and/or has an idea where to go from here?
Any help is appreciated!
I'm working on a large game and I just tried out the YYC instead of VM. Most things work perfectly, but I get this error:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Other Event: User Defined 15
for object objButtonListGraphicsQuick:
second index out of bounds request 0,6 maximum size is 1
############################################################################################
--------------------------------------------------------------------------------------------
called from - gml_Object_objButtonListGraphicsQuick_Other_25 (line 82)
called from - gml_Object_objMenuWidgetController_Other_13 (line 79)
called from - gml_Script_scrMenuLoad (line 169)
called from - gml_Object_objButtonSettingsGFX_Other_11 (line 4)
called from - gml_Object_objMenuWidgetController_Step_0 (line 166)
While trying to figure out what the problem is, I narrowed the code down to just this to reproduce the same error:
Code:
for (var i = 0; i < buttons; ++i) {
with(button_id[i]) {
// something happens
}
}
Code:
for (var i = 0; i < buttons; ++i) {
if !instance_exists(button_id[i]) show_error("one of the buttons doesn't exists", true);
}
Code:
var g = 0;
for (var i = 0; i < buttons; ++i) {
show_message("button_id is an instance, not an object_index: "+string(button_id[i]>1000)); //make sure that is is an instance id, not an object_index
if instance_exists(button_id[i]) {
show_message("button exists "+string(i)); //yup, button 0 it exists
g = 0;
with(button_id[i]) {
show_message("button executes some code "+string(i)); //all good for button 0
if g>0 show_error("Somehow -with- became a loop for multiple instances ...", true); //nope, this error doesn't show
g++;
}
// -----> but it crashes before showing the next message... (at i = 0) <------
show_message("button finished executing code "+string(i));
}
show_message("i goes ppppppp++");
}
I'm absolutely clueless where to go from here. This piece of code works fine as well when building with VM. And I did clear the cache multiple times before building with YYC.
Anyone experienced something similar and/or has an idea where to go from here?
Any help is appreciated!