• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[Trigger] Help With Leaderboard

Status
Not open for further replies.
Level 4
Joined
Jan 23, 2009
Messages
74
I am making an "Timed" AoS that has a secondary victory condition: most kills(including creeps)

for some reason the leader board is always blank

Trig. 1
Add all playing/user players to a leaderboard
set kill count value to zero
  • LeaderBoard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Leaderboard - Create a leaderboard for (All players) titled Kills
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
            • Else - Actions
          • Leaderboard - Show (Last created leaderboard)
Trig.2
Dealing with Leavers
  • Leaver
    • Events
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) 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
      • Leaderboard - Remove (Triggering player) from (Last created leaderboard)
Trig. 3
when a unit dies
Updates kill count on leaderboard to playerkills +1 for the killer if it was an enemy killed
sorts leaderboard values
  • LBUpdate
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set Playerkills[(Player number of (Owner of (Killing unit)))] = (Playerkills[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Playerkills[(Player number of (Owner of (Killing unit)))]
      • Leaderboard - Sort (Last created leaderboard) by Value in Descending order
Trig. 4
secondary win condition
  • Victory By kills
    • Events
      • Time - TimeLeft expires
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of (Player in position 1 of (Last created leaderboard))) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Skip dialogs, Skip scores)
by the way, in case it is important: i've only tested this from the WE testmap feature
 
Your first trigger isn't set up properly.
Every time that you go through each player you create a new leaderboard. You only need to create one leaderboard because you want everyone to see the same one.
Also you don't need to have an action that shows the leaderboard strait after it is created as it is set up to be showing.
To cut it short this is what the first trigger is disposed to look like.
  • LeaderBoard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Kills
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
            • Else - Actions
 
Status
Not open for further replies.
Top