• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Variable Question: Array?

Status
Not open for further replies.
Level 7
Joined
Feb 6, 2008
Messages
133
What is array?
Is it something like this?
Instead of using lots of integer variables, i could just use array.
Example: I have 11 integer variables, 11 teleport region and 11 teleported region. so the variables is to store the random generated number for each teleport region.. but i don't have to use that much integer variables right? i could just use 1 integer variable, set array size to 10 then just index them as 0 to 10 and use this one variable for all the teleport regions.. is this correct? or is it safer to separate the variable?
 
Last edited:
Level 10
Joined
Mar 31, 2009
Messages
732
Yes, arrays are generally zero based. WE doesn't enforce size limits, so you don't get array index out of bounds errors, except negative indexes.

Most functions from Blizzard.j will use 1-based indexes though, which includes most of what you see in the GUI triggers.
 
Status
Not open for further replies.
Top