• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Leaderboard

Status
Not open for further replies.
Level 5
Joined
Jun 24, 2009
Messages
118
Hi,how can i create leaderboard for two teams and write just team names,but count kills for all players ,not for only ex: player1[red] ?My trigger :

  • Table
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Team Kills
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
          • (Player 1 (Red) controller) Equal to User
        • Then - Actions
          • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label The Destroyers and value 0
          • Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label The Destroyers and value 0
          • Leaderboard - Add Player 3 (Teal) to (Last created leaderboard) with label The Destroyers and value 0
          • Leaderboard - Add Player 4 (Purple) to (Last created leaderboard) with label The Destroyers and value 0
          • Leaderboard - Add Player 5 (Yellow) to (Last created leaderboard) with label The Destroyers and value 0
          • Leaderboard - Add Player 6 (Orange) to (Last created leaderboard) with label The Guards and value 0
          • Leaderboard - Add Player 6 (Orange) to (Last created leaderboard) with label The Guards and value 0
          • Leaderboard - Add Player 8 (Pink) to (Last created leaderboard) with label The Guards and value 0
          • Leaderboard - Add Player 9 (Gray) to (Last created leaderboard) with label The Guards and value 0
          • Leaderboard - Add Player 10 (Light Blue) to (Last created leaderboard) with label The Guards and value 0
        • Else - Actions
          • Leaderboard - Show (Last created leaderboard)
Update For Team1

  • UpdateGuards
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
    • Conditions
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Set TeamKills_Copy[(Player number of (Owner of (Killing unit)))] = (TeamKills_Copy[(Player number of (Owner of (Killing unit)))] + 1)
        • Else - Actions
          • Set TeamKills_Copy[(Player number of (Owner of (Killing unit)))] = (TeamKills_Copy[(Player number of (Owner of (Killing unit)))] + 0)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TeamKills_Copy[(Player number of (Owner of (Killing unit)))] Equal to 120
            • Then - Actions
              • Set WinPointsG = (WinPointsG + 1)
              • Game - Display to (All players) the text: ((Name of (Player in position 2 of (Last created leaderboard))) + has been collected 120 kills and gets 1 victory point.)
            • Else - Actions
              • Leaderboard - Show (Last created leaderboard)
Update for team2

  • UpdateDestroyers
    • Events
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
    • Conditions
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Set TeamKills[(Player number of (Owner of (Killing unit)))] = (TeamKills[(Player number of (Owner of (Killing unit)))] + 1)
        • Else - Actions
          • Set TeamKills[(Player number of (Owner of (Killing unit)))] = (TeamKills[(Player number of (Owner of (Killing unit)))] + 0)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TeamKills[(Player number of (Owner of (Killing unit)))] Equal to 120
            • Then - Actions
              • Set WinPoints = (WinPoints + 1)
              • Game - Display to (All players) the text: ((Name of (Player in position 1 of (Last created leaderboard))) + has been collected 120 kills and gets 1 victory point.)
            • Else - Actions
              • Leaderboard - Show (Last created leaderboard)
When I test the game,there are five ''The Destroyers'' and five ''The Guards'' not only 1 :bored:
 
Level 5
Joined
Jun 24, 2009
Messages
118
Fail to you

Start reading my posts before posting. I dont need list of all players but only two teams.I have new trigger but now I have two ''The Destroyers''.. Anyway TL this topic coz I don't need help about leaderboard, I have been updated by map and now I need muldiboard.
 
Level 7
Joined
Mar 8, 2009
Messages
360
Why you add players to your leaderboard?
just do it this way:
  • Multiboard - Set the text for (Last created multiboard) item in column 3, row 2 to (Total kills: + (String((p1k + (p2k + (p3k + p4k))))))
And then let your multiboard refresh each econd, i uses a bit more cpu but since wc3 is so old , that shouldn' be a problem.
 
Status
Not open for further replies.
Top