I have this region called Lumber, and I need to make it so that when i put 10 rabbits inside that region, the rabbits disappear and 15 lumber is added to that player's lumber. I have a 7 player map.
In Starcraft, here's the trigger, and it works fine.
CONDITIONS:
-Current player brings at least 10 rabbits to Location 25
ACTIONS:
-Modify resources for current player: Add 15 Gas
-Remove 10 rabbits for current player location 25.
-Preserve trigger
When I use the WC3 triggers and place let's say, 13 rabbits in the region, they all disappear. If I change "Greater than or equal to"
to "equal to" and I place 13 rabbits inside the region, nothing happens. Is there a way to make it so that if i place more than 10 rabbits inside the region the game only removes 10 rabbits from the region and adds 15 lumber to the player's lumber? I think the unit group leaks, but I'll deal with that later.
Trigger:
- RabbitLumber
- Events
- Unit - A unit enters Lumber <gen>
- Conditions
- Actions
- Trigger - Run AddLumber <gen> (ignoring conditions)
- For each (Integer A) from 1 to 7, do (If ((Number of units in (Units in Lumber <gen> owned by (Player((Integer A))))) Greater than or equal to 10) then do (Unit Group - Pick every unit in (Units in Lumber <gen> owned by (Player((Integer A)))) and do (Unit - Remove (Picked unit) from the game))
- Events
Trigger:
- AddLumber
- Events
- Conditions
- Actions
- If ((Number of units in (Units in Lumber <gen>)) Equal to 10) then do (Player - Add 15 to (Player((Integer A))) Current lumber) else do (Do nothing)
In Starcraft, here's the trigger, and it works fine.
CONDITIONS:
-Current player brings at least 10 rabbits to Location 25
ACTIONS:
-Modify resources for current player: Add 15 Gas
-Remove 10 rabbits for current player location 25.
-Preserve trigger
When I use the WC3 triggers and place let's say, 13 rabbits in the region, they all disappear. If I change "Greater than or equal to"
to "equal to" and I place 13 rabbits inside the region, nothing happens. Is there a way to make it so that if i place more than 10 rabbits inside the region the game only removes 10 rabbits from the region and adds 15 lumber to the player's lumber? I think the unit group leaks, but I'll deal with that later.