- Joined
- Jun 12, 2007
- Messages
- 1,261
I have made 3 triggers using a loop, I'm not used to work with loops.
Because I can't test this for multiple players at the same time. (Since my map is not yet playable for multiple players.)
Could u check these 3 triggers and tell me if they are optimized good (for gui) and work fine?
I could only test them for 1player, not for multiple players so I think they might do weird stuff.
Because I can't test this for multiple players at the same time. (Since my map is not yet playable for multiple players.)
Could u check these 3 triggers and tell me if they are optimized good (for gui) and work fine?
I could only test them for 1player, not for multiple players so I think they might do weird stuff.
-
Player Kills
-
Events
- Unit - A unit Dies
- Conditions
-
Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of (Dying unit)) Equal to Player 12 (Brown)
- (Owner of (Killing unit)) Equal to (Player((Integer A)))
-
Then - Actions
- Set PlayerKills[(Integer A)] = (PlayerKills[(Integer A)] + 1)
- Multiboard - Set the text for GameStats item in column 4, row ((Integer A) + 1) to (String(PlayerKills[(Integer A)]))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Events
-
Player Dies
-
Events
- Unit - A unit Dies
- Conditions
-
Actions
- Set HeroesAlive = (HeroesAlive - 1)
-
For each (Integer A) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Dying unit) is A Hero) Equal to True
- (Owner of (Dying unit)) Equal to (Player((Integer A)))
-
Then - Actions
- Set PlayerAliveCheck[(Integer A)] = False
- Set PlayerRessurects[(Integer A)] = (PlayerRessurects[(Integer A)] - 1)
- Game - Display to (All players) the text: (PlayerColor[(Integer A)] + ((Name of (Player((Integer A)))) + has died.))
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
-
Loop - Actions
- Unit - Remove (Triggering unit) from the game
-
Loop - Actions
- Custom script: set bj_wantDestroyGroup = true
-
Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Actions)
-
Loop - Actions
- Player - Make (Picked player) treat (Player((Integer A))) as an Neutral with shared vision
-
Loop - Actions
- Multiboard - Set the text for GameStats item in column 2, row ((Integer A) + 1) to (|cffFF0202 + Dead)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PlayerRessurects[(Integer A)] Greater than or equal to 1
-
Then - Actions
- Set HeroGrave[(Integer A)] = (Position of (Dying unit))
- Unit - Create 1 Grave for (Player((Integer A))) at HeroGrave[(Integer A)] facing 270.00 degrees
- Custom script: call RemoveLocation(udg_HeroGrave[GetForLoopIndexA()])
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events
-
Player Leaves
-
Events
- Player - Player 1 (Red) leaves the game
- Player - Player 2 (Blue) leaves the game
- Player - Player 3 (Teal) leaves the game
- Player - Player 4 (Purple) leaves the game
- Player - Player 5 (Yellow) leaves the game
- Player - Player 6 (Orange) leaves the game
- Player - Player 7 (Green) leaves the game
- Player - Player 8 (Pink) leaves the game
- Conditions
-
Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering player) Equal to (Player((Integer A)))
-
Then - Actions
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Player((Integer A)))) and do (Actions)
-
Loop - Actions
- Unit - Remove (Picked unit) from the game
-
Loop - Actions
- Game - Display to (All players) the text: (PlayerColor[(Integer A)] + ((Name of (Player((Integer A)))) + has left the game, what a coward.))
- Multiboard - Set the text for GameStats item in column 2, row ((Integer A) + 1) to (PlayerColor[9] + -Left-)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Events