For some reason this is giving me an array out of bounds error even though I've checked it over many times and set the array size to some arbitrary number to test it. Any ideas?
In this mod, units can morph into other units so I was trying to store which unit is currently the hero of each player then have it respawn when it dies. I increased the size of the array cause it was giving me the error(though it didn't help).
Attachments:
None.
Out of curiosity, what did you increase the size of? I can't imagine the other array causing the error, since it seems to be within bounds.
None.
heros, im thinking there gotta be some bug or underlying error that its not telling me
None.
Whoops, I meant what did you increase it's size to*
None.
Oh, i changed it from 5 to 11 (well i went from 5 to 152 to 11 and just kinda left it there for testing)
None.

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
I think I know the problem.
EventUnit() will return -1 as the owner of the unit because the unit is dead and has no owner anymore [-1 is considered as "any" here].
My German tips tell me that I should use something like EventPlayer() to get the owner of the dead unit.
Try that!
Post has been edited 1 time(s), last time on Aug 20 2010, 7:50 am by Ahli. Reason: We no speak Americano!
That makes sense, thanks. I might think of another way around it but when I tried doing EventPlayer() instead, it gave me this error
00:00:27.31 Trigger Error in 'gt_Respawn_Func': An error occurred starting StarCraft II. Please try again.e_arrayIndexUnderflow
I've never heard of an underflow error before and I would guess it would mean it was -1 but wouldn't it have given me the same error before?
None.
Ah, i got it, it wasn't working because I had a timer before the creating action and for some reason it didn't store the triggering player past it. Thanks for the help guys
None.