HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Question on Arrays!

06-06-2004, 06:08 AM#1
Strom
I have one variable called my mailbox variable and I have it set to have 8 arrays, one array for each mailbox. and I set all the mailboxes to numbers. Like mailbox equals 1, and another mailbox equals 2. Now my question is, is I want to have another array for the players in my map. But since I already set the mailbox'es to equal 1 - 8, If I set the players 1-12 will I disrupt the array for the mailboxes, or vice versa?

Sincerely,

Strom Stonebeard
06-06-2004, 01:02 PM#2
linkmaster23
Well, you have three options here. You can do something called a false 2d array, which is pretty much doing a lot of multiplying and adding. I will show you one example.

6[the 6th player] * 8[the maximum number of mailboxes] + 1[the first mailbox] = 49

So your array would be Mailbox[49]

Another way would just to put data right in.

Player 6, Mailbox 4. Player 10, Mailbox1

Mailbox[64] Mailbox[101]

And the last way, is to mailbox array for each player. Giving each player 5 arrays. Which I do not suggest.
06-06-2004, 05:47 PM#3
Strom
Quote:
Originally Posted by linkmaster23
Well, you have three options here. You can do something called a false 2d array, which is pretty much doing a lot of multiplying and adding. I will show you one example.

6[the 6th player] * 8[the maximum number of mailboxes] + 1[the first mailbox] = 49

So your array would be Mailbox[49]

Another way would just to put data right in.

Player 6, Mailbox 4. Player 10, Mailbox1

Mailbox[64] Mailbox[101]

And the last way, is to mailbox array for each player. Giving each player 5 arrays. Which I do not suggest.

So your saying that I have to have both the players and the mailboxes in the same array. I can't have one array variable for players and another for mailboxes?

Cause the players and the mailboxes don't really have anything to do with each other. I'm just using a boolean array for the mail boxes to tell if there full or not, and I wanted to make another array for the players so when the players pick a character. The map will set a variable for the players. Like for instance.

Player 1 Picks Kid = set player[1] = kid
Player 2 Picks Orc = set player[2] = orc

Now my question is, will that array screw up my mail box array?

Thanks in advance. :D

Sincerely,

Strom
06-06-2004, 05:59 PM#4
MystWolf
theres no reason it would man, you can make as many arrays and as many variables as you want and they won't interfere with eachtoher without you making them interact inside triggers.
06-06-2004, 06:21 PM#5
Strom
Quote:
Originally Posted by MystWolf
theres no reason it would man, you can make as many arrays and as many variables as you want and they won't interfere with eachtoher without you making them interact inside triggers.

I just wondered because in order for the mailbox array to recognize the mailboxes I have to set there custom value to equal a # like 1,2,3, now if I set the players to a custom value # like 1,2,3 also. Would that screw up the arrays since there both set to the same custom value? Even though there being used in two different arrays?

Sincerely,

Strom Stonebeard
06-06-2004, 06:51 PM#6
MystWolf
yes i understand what you were doing with the custom values, and like i said no it will not interfere with eachother, they are in seperate arrays so don't worry about it.

now howabout hookin me up with some rep points :D