Variables are variables really. They are used to store data on a computer for future use and have a temporary address on your physical memory. You assign types such as.
Integer, Boolean, Real (decimal numbers), a unit, unit group etc.
You then make a trigger to declare what they want to equal, eg.
Set X = (Player 1's Current Gold) will make X whatever player 1's gold is. However, you may need to put a event to keep the variable constantly updated.
Then there are arrays, which is a variable which stores multiple values into one and are called by an index. eg.
hi[7] = 1, 155, 24, 234, 123243, 56, 645, 93
However, note that there are 8 elements compared to the [7]. That's because 0 is an active index. If i call hi[0], I get 1. Why do you this?
Say in a Hero Line Wars map, you would want income[11] rather than making 12 seperate variables. Note that although 0 may be an active index, it may not be in Warcraft III editor.
Quote:
|
Originally Posted by MyNameisMonky ok i get it...can somone help me with a trigger two..like theres this
unit that dont come up to often i need it to not come up two often...like randomly spawn. not liek every 60 seconds can ne one help |
Make a random number as Dari said, but it needs to be re-chosen when the player who commanded that unit died. Set a range for the random number function and it should work properly.