Hi guys, onto one of my map i need to count the number of a specify unit in a region. Knowing that the player can create more of that unit.
For example, how can i stock in a variable the number of marine the players control at that moment and how can i setup that when he has exactly 60 something happen ?
Hi guys, onto one of my map i need to count the number of a specify unit in a region. Knowing that the player can create more of that unit.
For example, how can i stock in a variable the number of marine the players control at that moment and how can i setup that when he has exactly 60 something happen ?
This looks more like a trigger issue rather than a data issue, but anyway, let's create the following trigger:-
Event - Any Unit Enters Region
Local Variable - Player = Owner of Triggering Unit <Integer>
Global/Local Variable - Marine Group (Player) = Empty Unit Group (8) -> Array of players, say 8 players.
Condition - (Unit Type of (Triggering Unit)) == Marine
Action
- Add Unit to Unit Group (Add Triggering Unit to Marine Group (Player)
- If then Else Conditions
- Number of Units in Unit Group (Marine Group (Player)) = 60
- Then, do Actions,
- Else, do Actions.
Is the above what you are looking for?
In reply to WilliamJay: