hmmmm this trigger seems really complicated especially cuz its got variables....thanks again tho people but im still lost, if u could gimme a layout of instrcutions starting from making the building which is simple and make ur own as an example then like say make a variable that does blah blah blah and explain variables a bit cuz i have barely a clue on how they work, if u could do that, man u dont know how much that would help me
ill put ur name in my map hehee +rep
The trigger itself I already wrote, now since you seem to really need a big explenation...
Making a building is done through the Object Manager, you could either edit a existing building or create a Custom building (which is a unit and thus I would refer to it as a unit from now on) by right clicking on any unit and click on the "
New Custom Unit..." button.
Now I wouldn't explain every button in the object manager since you can just look at their names and see what they do.
About variables - variables are just things you can store a value in, and later on refer to that value using the variable's name.
For example, a unit variable stores inside it a unit value, for example, Tiggering Unit, and later on you can refer to the Triggering Unit with the variable you stored it in.
You will probably mostly use this variables:
- Integers - Full numbers such as 1 , 20 , -53
- Units - the units in warcraft 3
- Points - locations that represent coordinates (x,y)
- Unit Groups - what more to say ?
- Booleans - variables that store True or False in them
To create a variable, go to the trigger editor, then click on the yellow
X ontop in the menu bar.
Then simply click on the green
+X to create a variable.
You will be asked to enter the name of the variable, the type of it, and then if it is arrayed or not.
Arrayes allow you simboly create diffrent "skins" of the same variable and give each its own value.
Hint: If you are making an array, just let it stay at the initial value of 1.
Now to use a variable in your triggers, you can use the "Set Variable" action to set them into a value (its the 8th action), or use them in events, conditions, and actions through the Variable bar.
When you create a action that needs a unit value for example, it will usually give you three boxes to choose that value from:
- Preset - No unit (not very helpfull for us)
- Variable - variable can be either a variable you set or a unit that is on the map, which you can select with the "Select Unit" button
- Function - a unit that is based on the event of the trigger
Another thing to notice is I used loops in my trigger above.
Loops are what they sound like, things that work again and again untill you tell them to stop.
They are represented by those "For each (Integer A) from X to Y, do (Actions)".
For more explenations about loops and the usage of them with arrays (which is what I did), read
this (click here) tutorial I made.
"
In the trigger I made I used the variable Income which is an integer.