HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Array question

12-07-2002, 01:21 AM#1
Guest
Hey again =)

How do the arrays work in Wc3? I've read elsewhere that since, Special Effects don't die w/ the unit, the best thing to do is to keep an array of all special effects created. I suppose this is so that you may remove them when the unit that they're applied to dies/is destroyed/is removed.

Now, I program in all sorts of languages (apparently, except for WE =p) and arrays are usually fixed length. Although, I suspect WE's arrays are not fixed, I'm wondering if they work more like maps? Are there boundary restrictions in WE's arrays? What about if you removed an element, does it automatically shift, or does it leave an index to null? Perhaps a finger to a good tutorial is what I'm asking for.

Second question:
Going back to the SFX array. Putting it in an array -- how does that help? After removing the unit w/ the SFX, how do you know which SFX to delete from memory (and from the array)? Unless, you do parallel array? Some more insight on this would be muc appreciated! Thanks =)

Doki
12-07-2002, 03:15 AM#2
Mr.123
About which SFX in which index of the array...

I believe Dataangel told me once that you could set the flying height of nonflying units and read it using triggers. So you could use this unused field to store the index of the array that has the SFX. I think there are other fields that goes unused most of the time that you can take advantage of.

Arrays don't automatically shift, that I know. I don't think it automatically points to null either. You'll have to set that yourself when you remove the SFX. To get either of these, bliz devs would've had to spend a lot of time coding for every little in return.
12-07-2002, 05:04 PM#3
Guest
Alternatively, you could use Point Value of a unit.