Hello there,
I am looking to make a trigger which count the amount of time an unit will use an ability, and after a certain amount of uses the unit loses his ability, my main problem, there are more than 1 type of this unit on the map and more can even be trained.
To make it clear : It's a dwarf unit which has an ability which is basically a Goblin Land Mine. I want theses dwarves to only be able to carry 2 mines, so after they dropped both of them on the ground, they lose the ability.
Making a single dwarf loses the ability isn't a problem, having an integer that count every dwarves on map and keeping in mind which one used 0, 1 or 2 times the Mine ability is.
For now my trigger is :
I've been doing some tests, Adding all unit type of dwarves as an unit group, using an integer, but i still don't know how to read every dwarf.
The long way i could do it is making a single trigger for each dwarf on the map, but since it's a trainable unit from a barrack, this sould take for ever and will probly conflict in the end.
Help would be much appreciated
I am looking to make a trigger which count the amount of time an unit will use an ability, and after a certain amount of uses the unit loses his ability, my main problem, there are more than 1 type of this unit on the map and more can even be trained.
To make it clear : It's a dwarf unit which has an ability which is basically a Goblin Land Mine. I want theses dwarves to only be able to carry 2 mines, so after they dropped both of them on the ground, they lose the ability.
Making a single dwarf loses the ability isn't a problem, having an integer that count every dwarves on map and keeping in mind which one used 0, 1 or 2 times the Mine ability is.
For now my trigger is :
-
DworfMines
-
Events
-
Unit - A unit Finishes casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Place Mine (Dworf)
-
-
Actions
-
Set VariableSet DworfMineCount = (DworfMineCount + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DworfMineCount Equal to 2
-
-
Then - Actions
-
Unit - Remove Place Mine (Dworf) from (Casting unit)
-
-
Else - Actions
-
Do nothing
-
-
-
-
I've been doing some tests, Adding all unit type of dwarves as an unit group, using an integer, but i still don't know how to read every dwarf.
The long way i could do it is making a single trigger for each dwarf on the map, but since it's a trainable unit from a barrack, this sould take for ever and will probly conflict in the end.
Help would be much appreciated