HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Array Types

08-28-2002, 07:05 PM#1
MiCroSlave
What exaclty is a variable with an array? Does that mean I can set it to two things, such as a Footmen and a Rifleman (For a Unit Type), which will allow me to compare that variable to a unit in the game?

Ex. Lets says I have a trigger that does X action when a Riflemen or Footmen enter a region. Could I have it set so that I only have to compare the entering unit to a varriable w/ an array?
08-28-2002, 07:13 PM#2
Guest
its like a list of variables. For instance, if you want to assign certain variables to buildings that are constructed somewhere during the game, you can use arrays. Like:

("Building" is a unit array.)
("countervariable" is an integer, initially 1.)

Event
Player1 finishes construction
Action
Set Building[countervariable]=constructed structure
set countervariable = countervariable +1

This way every structure that will be constructed by user will get a variable assigned to it, like first building[1], second building[2], third building[3], etc.
It's a list of variables that can get as long as you want.
08-29-2002, 01:02 AM#3
Draco
Another good use is to keep track of dalogs and dialog buttons. Insetead of lots of variables, like button1, button 2, etc., you can set the to an array like dialogbuttons[1],[2],[3], and so on. I think this makes your map smaller in size and lets it load faster.