Staredit Network > Forums > SC2 Assistance > Topic: [Solved] Array Out of Bounds Error
[Solved] Array Out of Bounds Error
This topic is locked. You can no longer write replies here.
Aug 20 2010, 4:19 am
By: FlareForce  

Aug 20 2010, 4:19 am FlareForce Post #1



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:
image.JPG
Hits: 10 Size: 82.76kb



None.

Aug 20 2010, 4:42 am shmeeps Post #2



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.

Aug 20 2010, 4:49 am FlareForce Post #3



heros, im thinking there gotta be some bug or underlying error that its not telling me



None.

Aug 20 2010, 4:59 am shmeeps Post #4



Whoops, I meant what did you increase it's size to*



None.

Aug 20 2010, 5:02 am FlareForce Post #5



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.

Aug 20 2010, 7:48 am Ahli Post #6

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!




Aug 20 2010, 3:54 pm FlareForce Post #7



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.

Aug 20 2010, 4:57 pm FlareForce Post #8



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.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:13 am]
DarkenedFantasies -- :sneaky:
[01:03 am]
O)FaRTy1billion[MM] -- but from one person all at once?
[01:02 am]
RIVE -- Eh, I've seen more. :wob:
[01:01 am]
O)FaRTy1billion[MM] -- thats a lotta wob
[07:30 pm]
Symmetry -- But why
[06:21 pm]
lil-Inferno -- :wob:
[2026-5-13. : 3:43 pm]
Apos -- :wob:
[2026-5-13. : 3:43 pm]
Apos -- :wob:
[2026-5-13. : 3:43 pm]
Apos -- :wob:
[2026-5-13. : 3:43 pm]
Apos -- :wob:
Please log in to shout.


Members Online: DarkenedFantasies