- Joined
- Jul 29, 2010
- Messages
- 319
I'm making a TD, I have 14 lanes, 1 per player, there is a region for each lane which covers the entirety of said lane, there is a region at the end of each lane which is the final stop for the creeps that will be running through the lanes, I'm trying to develop a trigger which when a unit enters the final region of a lane, it will get the player number of the player who has units in that lane. I also need that trigger to check if there are multiple players units in that lane at the time and check which player has the most units in that lane, this is just a failsafe in case for whatever reason a players builder just happens to wander into another players lane, so far I've tried all sorts of triggers such as
-
Unit enters portal
-
Events
-
Unit - A unit enters Lane 1 Portal <gen>
-
Unit - A unit enters Lane 2 Portal <gen>
-
Unit - A unit enters Lane 3 Portal <gen>
-
Unit - A unit enters Lane 4 Portal <gen>
-
Unit - A unit enters Lane 5 Portal <gen>
-
Unit - A unit enters Lane 6 Portal <gen>
-
Unit - A unit enters Lane 7 Portal <gen>
-
Unit - A unit enters Lane 8 Portal <gen>
-
Unit - A unit enters Lane 9 Portal <gen>
-
Unit - A unit enters Lane 10 Portal <gen>
-
Unit - A unit enters Lane 11 Portal <gen>
-
Unit - A unit enters Lane 12 Portal <gen>
-
Unit - A unit enters Lane 13 Portal <gen>
-
Unit - A unit enters Lane 14 Portal <gen>
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Triggering unit)) Equal to Player 21 (Coal)
-
-
Then - Actions
-
-------- Player --------
-
For each (Integer A) from 1 to 14, do (Actions)
-
Loop - Actions
-
-------- Region --------
-
For each (Integer B) from 1 to 14, do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in (Units in (Load (Integer B) of 7 in CONSTANT_Hashtable) owned by (Player((Integer A)))) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
((Load (Integer B) of 8 in CONSTANT_Hashtable) contains (Triggering unit)) Equal to True
-
((Load (Integer B) of 7 in CONSTANT_Hashtable) contains (Picked unit)) Equal to True
-
-
-
-
Then - Actions
-
Set NumberOfLives[(Integer A)] = (NumberOfLives[(Integer A)] - 1)
-
Game - Display to (Player group((Player((Integer A))))) for 0.25 seconds the text: (|c00FFFF00You have + ((String(NumberOfLives[(Integer A)])) + lives left.|r))
-
-
Else - Actions
-
-
-
-
-
-
-
-
-
Else - Actions
-
-
-