• 🏆 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] Ok. Some Problems With Leaderboard

Status
Not open for further replies.
Level 2
Joined
Apr 14, 2008
Messages
17
Alright. I made the leaderboard, refresh kills etc. But the tutorials on this only tell how to make leaderboards with "unit kills" not "hero kills". So each time someone kills a hero it resets back to 1 kill, can someone tell me how to fix this?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Point me to that tutorial, please.

What do you mean? So if a hero dies the leaderboard is reset to 1 kill? That doesn't make any sense, that's why I gotta see the tutorial.

Also, you can check if the killed unit is a hero or not.
 
Level 11
Joined
Dec 11, 2007
Messages
888
i think that variable that counts hero kills is set to 1 every time a hero dies
it must be like
  • Set HeroKills[(Player number of (owner of killing unit))] = HeroKills[(Player number of (owner of killing unit))] + 1
HeroKills is an array variable
 
Level 4
Joined
Sep 9, 2004
Messages
112
i think that variable that counts hero kills is set to 1 every time a hero dies
it must be like
  • Set HeroKills[(Player number of (owner of killing unit))] = HeroKills[(Player number of (owner of killing unit))] + 1
HeroKills is an array variable

If this doesn't fix your problem which it sounds like it will, then it would probably help if you would post your leaderboard triggers.
 
Level 2
Joined
Apr 14, 2008
Messages
17
Ok. Illidan, i have the same variable. Idk how to post my triggers. But it's all set-up like the tutorial said. What happens is when your playing the game, and you first kill a hero it goes to 1 kill. Then when you kill a hero again it goes to 0, then 5 seconds later jumps back to 1. and keeps doing it. Idk wtf is wrong.
 
Level 4
Joined
Sep 9, 2004
Messages
112
It sounds like you have a couple problems then and your going to have to post your trigger for anyone to able to really help you..

To post it, just open the WE.
Go into the trigger editor.
Select your trigger from the window on the left.
In the actual triggers window (Where it shows the events, conditions, ect.), Right click the Triggers name. Select the option "Copy as Text"

Then just paste it on here and wrap it with the trigger tags..

Should get this..and this is what your Kill trigger should essentially look like..
  • Hero Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set HeroKills[(Player number of (Owner of (Killing unit)))] = (HeroKills[(Player number of (Owner of (Killing unit)))] + 1)
      • Trigger - Run Leaderboard Refresh <gen> (ignoring conditions)
 
Level 11
Joined
Dec 11, 2007
Messages
888
  • Hero Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set HeroKills[(Player number of (Owner of (Killing unit)))] = (HeroKills[(Player number of (Owner of (Killing unit)))] + 1)
      • Trigger - Run Leaderboard Refresh <gen> (ignoring conditions)

why to run another trigger?

  • Hero Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set HeroKills[(Player number of (Owner of (Killing unit)))] = (HeroKills[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Change value for owner of killing unit in last created leaderboard to HeroKills[(Player number of (Owner of (Killing unit)))]
 
Level 4
Joined
Sep 9, 2004
Messages
112
Not really shure..just the way I taught myself how to make a leaderboard.. But then again when a unit dies on any map I've made it updates the player kills and the Groups kills as well so I do believe that way wouldn't really work unless maybe u use and if,then,else action and that might allow it to work..
 
Level 2
Joined
Apr 14, 2008
Messages
17
I found it out. RedMarine it was another trigger. Apparently it was the respawn trigger that was interferring, I didn't realize the run again 'set up leaderboard' trigger. That was supposed to be something else.

Thanks all of u.
 
Status
Not open for further replies.
Top