• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 11
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