00:00:00.00 Trigger Error in 'gt_MeleeInitialization_Func': Trying to access an element past the end of an array.
00:00:00.00 Running gt_MeleeInitialization_Func (Event: Map Initialization)
So... I'm not sure what is going on here:
I have an array of size 12. and I assign values at indexes 0-11 (I also tried 1-12, in case Galaxy is 1-indexed)... but I get this error regardless.
this is an action?
i'd definitely check the code in this.
actions, unless set to create a thread, run inside whatever action/trigger/function they are housed
so when that action gets an error it will report it using the parent trigger/action name
my favorite way to isolate problems is to create 2x Debug Messages
START and END
i put them around whatever action i think is causing the error.
an int[3] array creates:
int[0]
int[1]
int[2]
int[3]
print your lv_currentButton between creation and the array access
Galaxy array of size 12 means 0-11. Just like standard C.
Only arrays created in GUI get a +1 size bonus for being so sweet.
But if you look at the Galaxy code for GUI array declaration you'll see it includes the +1.
So a GUI array of size 12 is a Galaxy array of size 13.
Apart from that~ libNtve_gf_CreateDialogItemButton returns a dialog item index, iirc. So even if you create a bunch of dialog items without storing them in the array you'll be wasting memory.
I'd suggest something like that:
constintMAX_BUTTON_COUNT=100;intgv_currentButton=0;int[MAX_BUTTON_COUNT]gv_buttons;voidMakeNewButton(){if(gv_currentButton<=MAX_BUTTON_COUNT){//Check if we can still add buttons to the arraygv_buttons[gv_currentButton]=libNtve_gf_CreateDialogItemButton(...);gv_currentButton+=1;//Increment button count by 1}else{DebugMessage("Ok, now we made too many buttons >.>");}}
That's a better idea, unless you have a lot of dialog items and need to do something like this:
00:00:00.00 Trigger Error in 'gt_MeleeInitialization_Func': Trying to access an element past the end of an array. 00:00:00.00 Running gt_MeleeInitialization_Func (Event: Map Initialization)
So... I'm not sure what is going on here: I have an array of size 12. and I assign values at indexes 0-11 (I also tried 1-12, in case Galaxy is 1-indexed)... but I get this error regardless.
Here is the only code in MeleeInitialization
gv_startPositions is a point array of size 12
Do I need to init the array somehow?
@DerNalia: Go
The array only has to be size 11 for that in galaxy. :(
You seem to know what your doing, uhhhhh....... I see no problems.
@grenegg: Go
Aye, thanks for that lil bit of info.
Unfortunately, Galaxy Editor gives me no idea where / what is causing this error. Is there someway to turn on like... Super Debug God mode?
gf_initSelectGUI();
this is an action?
i'd definitely check the code in this.
actions, unless set to create a thread, run inside whatever action/trigger/function they are housed
so when that action gets an error it will report it using the parent trigger/action name
my favorite way to isolate problems is to create 2x Debug Messages
START and END
i put them around whatever action i think is causing the error.
@maverck: Go
you were right.
My problem is I"m trying to store DialogItems as the index of an array:
Guess I'll have to make the array really big
arrays in galaxy are strange newb firendly.
an int[3] array creates:
int[0]
int[1]
int[2]
int[3]
print your lv_currentButton between creation and the array access
@b0ne123: Go
what???? That makes even less sense than the other two expected methods...
Galaxy array of size 12 means 0-11. Just like standard C.
Only arrays created in GUI get a +1 size bonus for being so sweet.
But if you look at the Galaxy code for GUI array declaration you'll see it includes the +1.
So a GUI array of size 12 is a Galaxy array of size 13.
Apart from that~ libNtve_gf_CreateDialogItemButton returns a dialog item index, iirc. So even if you create a bunch of dialog items without storing them in the array you'll be wasting memory.
I'd suggest something like that:
That's a better idea, unless you have a lot of dialog items and need to do something like this:
PS: Lovin' the iRush portrait :D