- Joined
- Aug 22, 2006
- Messages
- 8
I have two triggers that are supposed to check how many mines (beacons) a user has under control. But I cannot get them to work as I want.
The idea for this trigger was supposed to be: If player has atleast 1 structure next to the beacon, and no other player has any structures next to the beacon, set variable value to itself plus 1. But I can't quite figure it out.
This is what I currently have (as a test for player 1, note Player1Mines is an integer var):
Mine 1e001 Copy
Events
Unit - A unit enters resource 1e001 <gen>
Conditions
((Triggering unit) is A structure) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 200.00 of ((Position of Resource (Ore) 0005 <gen>) offset by (0.00, 0.00)) matching (((Triggering unit) is A structure) Equal to True))) Greater than or equal to 1
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Then - Actions
Multiboard - Set the text for (Last created multiboard) item in column 4, row 2 to ((String(Player1Mines)) + 1)
Set Player1Mines = (Player1Mines + 1)
Else - Actions
Do nothing
I cannot figure out how to have the conditions check to see if enemy structures are within the same location as the beacon.
The same problem is on the second trigger. I am just wondering if anyone would help me with this problem. I thought I understood triggers pretty well but this one just stumps me. Please somebody help.
The idea for this trigger was supposed to be: If player has atleast 1 structure next to the beacon, and no other player has any structures next to the beacon, set variable value to itself plus 1. But I can't quite figure it out.
This is what I currently have (as a test for player 1, note Player1Mines is an integer var):
Mine 1e001 Copy
Events
Unit - A unit enters resource 1e001 <gen>
Conditions
((Triggering unit) is A structure) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 200.00 of ((Position of Resource (Ore) 0005 <gen>) offset by (0.00, 0.00)) matching (((Triggering unit) is A structure) Equal to True))) Greater than or equal to 1
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Then - Actions
Multiboard - Set the text for (Last created multiboard) item in column 4, row 2 to ((String(Player1Mines)) + 1)
Set Player1Mines = (Player1Mines + 1)
Else - Actions
Do nothing
I cannot figure out how to have the conditions check to see if enemy structures are within the same location as the beacon.
The same problem is on the second trigger. I am just wondering if anyone would help me with this problem. I thought I understood triggers pretty well but this one just stumps me. Please somebody help.