hi,
this editor drives me crazy. i really did a lot with the wc3 editor.
i want that when i finish to build a unit of a certain type to give them a variable , so i can refer later on it. if its building b i want to give it variable b. but i dont know how.
i did: if a unit is finished ... action: if unit is from typ x > set variable ????
Variables are now placed in the same tree as Triggers, Actions Definitions, Functions and so on. Try selecting a Trigger in the library tree in the left-most area and press [Ctrl+B]. Name your variable and set the variable type.
For changing the values in the variable simply use the "Set Variable", as Quelor described.
There are two kinds of variables. Global and Local.
Local variables are the ones you put inside your triggers. These can only be used from within that trigger and are unique to each run of that trigger.
Global variables can be used from anywhere. They are placed in the left area of the window (dunno what to call it).
There are two kinds of variables. Global and Local.
Local variables are the ones you put inside your triggers. These can only be used from within that trigger and are unique to each run of that trigger.
Global variables can be used from anywhere. They are placed in the left area of the window (dunno what to call it).
One thing to note is that if you want each created unit to have it's own variable then you would need an array and a variable that would increase the 'array value' so you don't keep overwriting a unit.
...or if the variable you want associated with the unit happens to be a "Real", you can use the custom value. An array is more flexible, but then you would have to keep track of all, sometimes an unknown number of, created units. Would be great if you could assign any type of variable to a unit like this, but as far as I can see, we can't.
hi, this editor drives me crazy. i really did a lot with the wc3 editor.
i want that when i finish to build a unit of a certain type to give them a variable , so i can refer later on it. if its building b i want to give it variable b. but i dont know how.
i did: if a unit is finished ... action: if unit is from typ x
> set variable ????@PsychoMC: Go
Event: A unit is finished (Or whatever) Cond: Action: Set X > Triggering unit.
@PsychoMC: Go
Variables are now placed in the same tree as Triggers, Actions Definitions, Functions and so on. Try selecting a Trigger in the library tree in the left-most area and press [Ctrl+B]. Name your variable and set the variable type.
For changing the values in the variable simply use the "Set Variable", as Quelor described.
@Quelor: Go
aaah i have to set the variable before in the same trigger... aaah :)
and i want to make one of the condition that the finished building is in a certain area, how can i do that?
how can i refer to that unit in the variable later? if i want to to that, the variables tabs stays empty...
There are two kinds of variables. Global and Local.
Local variables are the ones you put inside your triggers. These can only be used from within that trigger and are unique to each run of that trigger.
Global variables can be used from anywhere. They are placed in the left area of the window (dunno what to call it).
One thing to note is that if you want each created unit to have it's own variable then you would need an array and a variable that would increase the 'array value' so you don't keep overwriting a unit.
...or if the variable you want associated with the unit happens to be a "Real", you can use the custom value. An array is more flexible, but then you would have to keep track of all, sometimes an unknown number of, created units. Would be great if you could assign any type of variable to a unit like this, but as far as I can see, we can't.