HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Storing an integer array

10-17-2008, 08:15 PM#1
Bobo_The_Kodo
What would the best way of storing an integer array onto a unit be?(for all units)
10-17-2008, 08:44 PM#2
TEC_Ghost
Unit Indexing, check out PUI in the systems section.

Basically you give each unit an Index number (1,2,3 etc) then you can call up arrays stored with that integer like, myStruct[1].IntegerArray.
10-18-2008, 05:13 AM#3
Bobo_The_Kodo
an array inside a struct limits the size of that struct to 8192/(size of biggest array) though
10-18-2008, 06:44 AM#4
dead_or_alivex
That wasn't the point of TEC's post - the struct thing was an example. Use PUI or Rising_Dusk's more lightweight indexing utilities snippet.
10-18-2008, 11:45 AM#5
the-thingy
Quote:
Originally Posted by Bobo_The_Kodo
an array inside a struct limits the size of that struct to 8192/(size of biggest array) though
What size array are you planning on having, and do you expect to achieve 8192/arraySize units existing in the game at any one time? Unless the array size is fairly large (if that was the case, just use an extra integer array?), WC3 is more likely to crawl along at a snail's pace before you reach the limit

Anyway, can't you oversize structs? If the array size was really that high, you could just beef up the struct size instead

(Also, isn't struct instance limit 8190?)