• 🏆 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!

leaderboard help

Status
Not open for further replies.
Level 6
Joined
Jul 13, 2007
Messages
173
hello i have a little problem with my leaderboard
it should be so that every time i kill a sheep it will +1 on the leaderboard score but the problems is that it only +1 at the first sheep i kill and do nothing at the next ones here is my triggers.

  • 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
              • Leaderboard - Show (Last created leaderboard)
Untitled Trigger 001
Events
Unit - A unit Dies
Conditions
((Dying unit) belongs to an enemy of Player 1 (Red)) Equal to True
Actions
Set sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] = sheep_kill_leaderboard[(sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] + 1)
Leaderboard - Sort (Last created leaderboard) by Value in Descending order

EDIT:

it should be so that every time i kill a sheep it will +1 on the leaderboard score but the problems is that it only +1 at the first sheep i kill and do nothing at the next ones here is my triggers.

  • 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
              • Leaderboard - Show (Last created leaderboard)
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) belongs to an enemy of Player 1 (Red)) Equal to True
    • Actions
      • Set sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] = sheep_kill_leaderboard[(sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] + 1)]
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Sort (Last created leaderboard) by Value in Descending order[/QUOTE]
sry for double posting but plz help

Do NOT double-post. Use the Edit Post button.
~Posts Merged
 
Last edited by a moderator:
Level 11
Joined
Dec 11, 2007
Messages
888
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) belongs to an enemy of Player 1 (Red)) Equal to True
    • Actions
      • Set sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] = sheep_kill_leaderboard[(sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))] + 1)]
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (sheep_kill_leaderboard[(Player number of (Owner of (Killing unit)))]
      • Leaderboard - Sort (Last created leaderboard) by Value in Descending order
try this one. change the value for player to sheep_kill_leaderboard not to sheep_kill_leaderboard + 1
 
Level 6
Joined
Jul 13, 2007
Messages
173
the sheep_kill_leaderboard is an integer array and i will try that ady_illidan

ady_illidan sry but you help didnt work it dont even count the first one now

Do NOT double-post. Use the Edit Post button.
~Posts Merged
 
Last edited by a moderator:
Status
Not open for further replies.
Top