Eyonix
TH.net Regular
- Reaction score
- 16
Im making a King of the Hill map, and if you control the hill for so long you win.
but my multiboard won't add all the players to it, it adds red and then adds blue but no one else....
Also my other problem is when a unit leaves the area even if you are the only one on the hill and have like 5 more units on it, the timer still stops.
Heres the triggers, sorry they are pretty long.
I think the problems are in the 2nd and 4th trigger, but im not sure because I didn't make this trigger.
It was 1000 range but i changed it to 5000 and it still only adds red and blue, and all the players' units are the same distance away or pretty close to it.
but my multiboard won't add all the players to it, it adds red and then adds blue but no one else....
Also my other problem is when a unit leaves the area even if you are the only one on the hill and have like 5 more units on it, the timer still stops.
Heres the triggers, sorry they are pretty long.
I think the problems are in the 2nd and 4th trigger, but im not sure because I didn't make this trigger.
Trigger:
- Map Initialization for Muiltiboard
- Events
- Map initialization
- Conditions
- Actions
- For each (Integer A) from 1 to (Number of players in (All players controlled by a User player)), do (Actions)
- Loop - Actions
- Set timeKeeper[(Player number of ownerOfMostUnits)] = 300
- Loop - Actions
- Set Players_Playing = (All players matching (((Matching player) slot status) Equal to Is playing))
- -------- Gold Color --------
- Set Players_ColorCodes[0] = |cffffcc00
- -------- Players Colors --------
- Set Players_ColorCodes[1] = |c00ff0303
- Set Players_ColorCodes[2] = |c000042ff
- Set Players_ColorCodes[3] = |c001ce6b9
- Set Players_ColorCodes[4] = |c00540081
- Set Players_ColorCodes[5] = |c00fffc01
- Set Players_ColorCodes[6] = |c00feba0e
- Set Players_ColorCodes[7] = |c0020c000
- Set Players_ColorCodes[8] = |c00e55bb0
- Set Players_ColorCodes[9] = |cFF7EBFF1
- Set Players_ColorCodes[10] = |cFF106246
- Set Players_ColorCodes[11] = |CFF4E2A04
- Set Players_ColorCodes[12] = |cFF4E2A04
- Set ColorCodes_EndTag = |r
- Set Tier[Player_Number] = 1
- For each (Integer A) from 1 to (Number of players in (All players controlled by a User player)), do (Actions)
- Events
Trigger:
- Create MultiBoard
- Events
- Time - Elapsed game time is 0.03 seconds
- Conditions
- Actions
- Leaderboard - Create a leaderboard for (All players controlled by a User player) titled ownerOfMostNumberOf...
- Set leaderBoardTimerKeeper = (Last created leaderboard)
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Leaderboard - Add (Picked player) to leaderBoardTimerKeeper with label (Name of (Picked player)) and value (Number of units in (Units within 5000.00 of (Center of Hill <gen>) matching (((Matching unit) is alive) Equal to True))) Leaderboard - Hide leaderBoardTimerKeeper
- Loop - Actions
- -------- Column 1 --------
- Multiboard - Create a multiboard with 4 columns and (1 + (Number of players in Players_Playing)) rows, titled Score
- Set Multiboard = (Last created multiboard)
- Multiboard - Hide Multiboard
- Multiboard - Set the text for Multiboard item in column 1, row 1 to (Players_ColorCodes[0] + ([Players] + ColorCodes_EndTag))
- Multiboard - Set the text for Multiboard item in column 2, row 1 to (Players_ColorCodes[0] + ([Tier] + ColorCodes_EndTag))
- Multiboard - Set the text for Multiboard item in column 3, row 1 to (Players_ColorCodes[0] + ([Kills] + ColorCodes_EndTag))
- Multiboard - Set the text for Multiboard item in column 4, row 1 to (Players_ColorCodes[0] + ([Time In Control] + ColorCodes_EndTag))
- -------- Width --------
- Multiboard - Set the width for Multiboard item in column 1, row 0 to 7.00% of the total screen width
- Multiboard - Set the width for Multiboard item in column 2, row 0 to 4.00% of the total screen width
- Multiboard - Set the width for Multiboard item in column 3, row 0 to 4.00% of the total screen width
- Multiboard - Set the width for Multiboard item in column 4, row 0 to 9.00% of the total screen width
- For each (Integer A) from 1 to (Number of players in Players_Playing), do (Actions)
- Loop - Actions
- -------- Adding Players --------
- Set Player_Row = (Player_Row + 1)
- Set playerRow[(Integer A)] = (Player((Integer A)))
- Set Player_Color = (Player_Color + 1)
- Multiboard - Set the text for Multiboard item in column 1, row Player_Row to (Players_ColorCodes[Player_Color] + ((Name of (Player(Player_Color))) + ColorCodes_EndTag))
- -------- Tier --------
- Multiboard - Set the text for Multiboard item in column 2, row Player_Row to (Players_ColorCodes[Player_Color] + ((String(Tier[Player_Number])) + ColorCodes_EndTag))
- -------- Kills --------
- Multiboard - Set the text for Multiboard item in column 3, row Player_Row to (Players_ColorCodes[Player_Color] + ((String(Kill_Count[Player_Number])) + ColorCodes_EndTag))
- Loop - Actions
- Multiboard - Set the display style for Multiboard item in column 0, row 0 to Show text and Hide icons
- Multiboard - Show Multiboard
- Events
It was 1000 range but i changed it to 5000 and it still only adds red and blue, and all the players' units are the same distance away or pretty close to it.
Trigger:
- Add To Kills
- Events
- Unit - A unit Dies
- Conditions
- (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
- Actions
- Set Kill_Count[Player_Number] = (Kill_Count[Player_Number] + 1)
- Multiboard - Set the text for Multiboard item in column 3, row ((Player number of (Owner of (Killing unit))) + 1) to (Players_ColorCodes[Player_Color] + ((String(Kill_Count[Player_Number])) + ColorCodes_EndTag))
- Events
Trigger:
- activateTimer
- Events
- Unit - A unit enters Hill <gen>
- Unit - A unit leaves Hill <gen>
- Conditions
- Actions
- Leaderboard - Sort leaderBoardTimerKeeper by Value in Descending order
- Set ownerOfMostUnits = (Player in position 1 of leaderBoardTimerKeeper)
- Unit Group - Pick every unit in (Units owned by ownerOfMostUnits) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Entering unit) is in (Units owned by ownerOfMostUnits)) Equal to True
- Then - Actions
- Trigger - Turn on timer <gen>
- Else - Actions
- Trigger - Turn off timer <gen>
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in (Units owned by ownerOfMostUnits) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Leaving unit) is in (Units owned by ownerOfMostUnits)) Equal to True
- Then - Actions
- Trigger - Turn off timer <gen>
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Events
Trigger:
- timer
- Events
- Time - Every 0.01 seconds of game time
- Conditions
- Actions
- Set timeMilisecs[(Player number of ownerOfMostUnits)] = (timeMilisecs[(Player number of ownerOfMostUnits)] + 1)
- Set timeMilisecsString[(Player number of ownerOfMostUnits)] = (String(timeMilisecs[(Player number of ownerOfMostUnits)]))
- Set timeSecondsString[(Player number of ownerOfMostUnits)] = (String(timeSeconds[(Player number of ownerOfMostUnits)]))
- Set timeMinutesString[(Player number of ownerOfMostUnits)] = (String(timeMinutes[(Player number of ownerOfMostUnits)]))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- timeMilisecs[(Player number of ownerOfMostUnits)] Equal to 100
- Then - Actions
- Set timeMilisecs[(Player number of ownerOfMostUnits)] = 0
- Set timeMilisecsString[(Player number of ownerOfMostUnits)] = (String(timeMilisecs[(Player number of ownerOfMostUnits)]))
- Set timeSeconds[(Player number of ownerOfMostUnits)] = (timeSeconds[(Player number of ownerOfMostUnits)] + 1)
- Set timeSecondsString[(Player number of ownerOfMostUnits)] = (String(timeSeconds[(Player number of ownerOfMostUnits)]))
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- timeSeconds[(Player number of ownerOfMostUnits)] Equal to 60
- Then - Actions
- Set timeSeconds[(Player number of ownerOfMostUnits)] = 0
- Set timeSecondsString[(Player number of ownerOfMostUnits)] = (String(timeSeconds[(Player number of ownerOfMostUnits)]))
- Set timeMinutes[(Player number of ownerOfMostUnits)] = (timeMinutes[(Player number of ownerOfMostUnits)] + 1)
- Set timeMinutesString[(Player number of ownerOfMostUnits)] = (String(timeMinutes[(Player number of ownerOfMostUnits)]))
- Else - Actions
- If - Conditions
- If ((Integer(timeMilisecsString[(Player number of ownerOfMostUnits)])) Less than 10) then do (Set timeMilisecsString[(Player number of ownerOfMostUnits)] = (0 + (String(timeMilisecs[(Player number of ownerOfMostUnits)])))) else do (Do nothing)
- If ((Integer(timeSecondsString[(Player number of ownerOfMostUnits)])) Less than 10) then do (Set timeSecondsString[(Player number of ownerOfMostUnits)] = (0 + (String(timeSeconds[(Player number of ownerOfMostUnits)])))) else do (Do nothing)
- If ((Integer(timeMinutesString[(Player number of ownerOfMostUnits)])) Less than 10) then do (Set timeMinutesString[(Player number of ownerOfMostUnits)] = (0 + (String(timeMinutes[(Player number of ownerOfMostUnits)])))) else do (Do nothing)
- Multiboard - Set the text for Multiboard item in column 4, row ((Player number of ownerOfMostUnits) + 1) to ((timeMinutesString[(Player number of ownerOfMostUnits)] + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + (timeSecondsString[(Player number of ownerOfMostUnits)] + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + timeMilisecsString[(Player number of ownerOfMostUnits)])))
- Events