- Joined
- Apr 27, 2005
- Messages
- 28
I have this trigger which is ment to not allow you to select more that 1 builing at a time of the same builing type.
The problem is that this trigger does not allow you to select even one building... My personal though on what the problem is, is that the trigger upon selection adds one and thus deselct( even with only 1 building)... So i need to modify this trigger to add up the number of buildings selected... WHICH i dont know how to do. Anyone have any ideas for this?
Code:
Build
Events
Player - Player 1 (Red) Selects a unit
Conditions
((Triggering unit) is A structure) Equal to True
Actions
Set tmpInteger = 0
Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to (Unit-type of (Picked unit))
Then - Actions
Set tmpInteger = (tmpInteger + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
tmpInteger Greater than 1
Then - Actions
Selection - Remove (Picked unit) from selection for (Triggering player)
Else - Actions
Else - Actions
The problem is that this trigger does not allow you to select even one building... My personal though on what the problem is, is that the trigger upon selection adds one and thus deselct( even with only 1 building)... So i need to modify this trigger to add up the number of buildings selected... WHICH i dont know how to do. Anyone have any ideas for this?