HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variable question (help a newb)

10-09-2002, 03:26 AM#1
Guest
When you make a variable what exaclty does array mean?
10-09-2002, 03:55 AM#2
ph33rb0
An array is like having multiple variables inside of one. Most commonly, I use arrays to store values that you want for all players. For instance, Say you wanted to store a variable of how many farms each player has. Now you COULD make 12 variables, one for each player, but instead, make an integer array, and use the number to represent the player. For instance, intFarms[1] would be how many farms player one has, and intFarms[5] would be the number player 5 has.

Get it?
10-09-2002, 04:19 AM#3
DKSlayer
Yea like he said. You goto Variables and say New variable. Type in a name, select the type like integer, and click array.
For IE;
intFarms
if you want to store something in your array you just select the action of Set Variable select intFarm then type in a index number usually start with 0 then go up then enter your number
intFarms(0) = 2 (should look kinds like this)
lets say you want to do that for another variable
intFarms(1) = 40
Easy as that
and if you wan to pull that variable up again later just
use intFarms(0) and it will pull up that number. Pretty easy. An array is basicly a way to not have to declare lots of different variables. If you start to really grasp array's you can do some awesome stuff with them though.
10-09-2002, 03:31 PM#4
Guest
I replied to that question once, search the forum for variable and array, there are plenty of topics on it..
10-09-2002, 09:16 PM#5
Guest
Ya alot of topics get constantly repeated just b/c ppl are too lazy to use the search button.:bgrun: