• 🏆 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 Kills Updater

Status
Not open for further replies.
Level 4
Joined
Jun 20, 2008
Messages
22
I have made leader board kills updater using the tutorials throughout the internet yet it does not work. Here is the trigger of which i have no answer to...
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
  • Actions
    • Set Kills[(Player number of (Owner of (Killing unit)))] = Kills[((Player number of (Owner of (Killing unit))) + 1)]
    • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]
    • Leaderboard - Sort (Last created leaderboard) by Value in Descending order
The variable used is a integer array 11 for the 11 players and is labeled as "Kills".

Please help me thank you.:spell_breaker:
 
Level 4
Joined
Jun 20, 2008
Messages
22
The Create Leader board Trigger
  • Events
    • Time - Elapsed game time is 0.05 seconds
  • Conditions
  • Actions
    • Leaderboard - Create a leaderboard for (All players) titled Player Kills
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (((Picked player) controller) Equal to User) then do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0) else do (Leaderboard - Show (Last created leaderboard))
The tally trigger
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • (Owner of (Dying unit)) Not equal to Player 12 (Brown)
  • Actions
    • Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
    • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]
    • Leaderboard - Sort (Last created leaderboard) by Value in Descending order
player 12 is the creep in the game.The variable is Integer array 11.
This one removes the player from the leaderboard and other stuff.
  • 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
    • Player - Player 9 (Gray) leaves the game
    • Player - Player 10 (Light Blue) leaves the game
    • Player - Player 11 (Dark Green) leaves the game
  • Conditions
  • Actions
    • Leaderboard - Remove (Triggering player) from (Last created leaderboard)
    • Game - Display to (All players) for 30.00 seconds the text: A player has left t...
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • Unit - Make (Picked unit) Rescuable by (All players)
    • Wait 10.00 seconds
    • Game - Display to (All players) the text: The players units w...
That's everything associated with it.
 
Level 13
Joined
Jun 23, 2009
Messages
294
Seems fine to me too.

But... maybe it's a problem with dummies... try to add a condition like:

  • Conditions
    • (Dying Unit) Not equal to Yourdummyunit
Try also with debug messages. In the case you can't manage to solve it try with a boolean "switch":

  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • (Owner of (Dying unit)) Not equal to Player 12 (Brown)
    • Killcheck[(Player number of (Owner of (Killing unit)))] Equal to False
  • Actions
    • Set Killcheck[(Player number of (Owner of (Killing unit)))] = True
    • Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
    • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]
    • Leaderboard - Sort (Last created leaderboard) by Value in Descending order
    • Wait 0.01 seconds
    • Set Killcheck[(Player number of (Owner of (Killing unit)))] = False
 
Level 4
Joined
Jun 20, 2008
Messages
22
It seems i have fixed the problem.

  • Conditions
    • (Killing unit) Not equal to (Summoned unit)
Apparently the hero you get at the star can summon units which I used for every test, but long after the summons were dead the kills would still be randomly 3 instead of 1 which doesn't make any sense.

Thank you for the better conditions trigger even though i fixed it.
:thumbs_up:
 
Status
Not open for further replies.
Top