Leaderboard for RoC!

SnowCrow

New Member
Reaction score
7
Why is the leaderboard tutorial only for TFT? Many people still want to or have to do maps for RoC.
So, if anyone knew how to do a leaderboard for RoC, please help!
I need a leaderboard to keep track of each players (12 players) gold amount. Or if not that, then at least kills.

And btw, I have TFT editor. Is it possible to use WinMPQ to get TFT leaderboards for RoC?
 
I

IndianSummer

Guest
As far as I know, it's possible to do a TFT trigger and convert it into JASS somehow and it's still RoC...at least I heard something about it :p
 

Leo

New Member
Reaction score
14
I haven't needed to make leaderboards for any of my RoC maps so I dunno offhand if they work.

If its possible, do it by just making the trigger in TfT. If you don't know JASS, test it in TFT, than when its working, convert it into custom text and it should work just fine in RoC then.
 

Sooda

Diversity enchants
Reaction score
318
Have you ever on earth considered to use search function before you ask something ? Yes it is possible and it needs to be made in JASS but it works only with ROC what has update of 1.17 or higher.
 

SnowCrow

New Member
Reaction score
7
Have you ever on earth considered to use search function before you ask something ? Yes it is possible and it needs to be made in JASS but it works only with ROC what has update of 1.17 or higher.

Well, I searched twice and checked almost all of the topics, but found no help there.
My friend once did a leaderboard with timer for RoC (without JASS), but the names jumped all around if the players were tied. I copy the leaderboard here.

Code:
Imadoofus
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players) titled Kills
        Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label (Name of Player 1 (Red)) and value 0
        Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label (Name of Player 2 (Blue)) and value 0
        Leaderboard - Add Player 3 (Teal) to (Last created leaderboard) with label (Name of Player 3 (Teal)) and value 0
        Leaderboard - Add Player 4 (Purple) to (Last created leaderboard) with label (Name of Player 4 (Purple)) and value 0
        Leaderboard - Add Player 5 (Yellow) to (Last created leaderboard) with label (Name of Player 5 (Yellow)) and value 0
        Leaderboard - Show (Last created leaderboard)
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order
        Countdown Timer - Create a timer window for Timer with title Time
        Countdown Timer - Start Timer as a One-shot timer that will expire in 1200.00 seconds

Code:
Le Aderboardette
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Player1Kills
        Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to Player2Kills
        Leaderboard - Change the value for Player 3 (Teal) in (Last created leaderboard) to Player3Kills
        Leaderboard - Change the value for Player 4 (Purple) in (Last created leaderboard) to Player4Kills
        Leaderboard - Change the value for Player 5 (Yellow) in (Last created leaderboard) to Player5Kills
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order
        If ((Player 1 (Red) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 1 (Red) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 2 (Blue) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 2 (Blue) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 3 (Teal) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 3 (Teal) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 4 (Purple) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 4 (Purple) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 5 (Yellow) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 5 (Yellow) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 1 (Red) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 1 (Red) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 2 (Blue) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 2 (Blue) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 3 (Teal) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 3 (Teal) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 4 (Purple) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 4 (Purple) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 5 (Yellow) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 5 (Yellow) from (Last created leaderboard)) else do (Do nothing)

Code:
CheckBbq
    Events
        Time - Timer expires
    Conditions
    Actions
        If ((Position of Player 1 (Red) in (Last created leaderboard)) Equal to 1) then do (Trigger - Turn on OmgRedWins <gen>) else do (Do nothing)
        If ((Position of Player 2 (Blue) in (Last created leaderboard)) Equal to 1) then do (Trigger - Turn on OmgBlueWins <gen>) else do (Do nothing)
        If ((Position of Player 3 (Teal) in (Last created leaderboard)) Equal to 1) then do (Trigger - Turn on OmgTealWins <gen>) else do (Do nothing)
        If ((Position of Player 4 (Purple) in (Last created leaderboard)) Equal to 1) then do (Trigger - Turn on OmgPurpleWins <gen>) else do (Do nothing)
        If ((Position of Player 5 (Yellow) in (Last created leaderboard)) Equal to 1) then do (Trigger - Turn on OmgYellowWins <gen>) else do (Do nothing)
Then there was the victory trigger for each player.
But I don't understand much about this, could someone help with this?
 

SnowCrow

New Member
Reaction score
7
Anyone?
Well, I kinda get it, but I don't understand the variables and how to keep track of the gold amount.
 

Corleone

New Member
Reaction score
44
1) What exactly do you mean by "Players tied"? That they had the same score?
2) You should create timer windows after you start a timer.
 

Corleone

New Member
Reaction score
44
Well, from what I see, you should just simplify the triggers.

You keep removing all the non-used player spots from the leaderboard, but with a simple If//Then//Else statement you could skip adding them in the first place.
You should also just use a "A unit dies" event in another trigger and then add +1 to the killing player's kill-value in an array and update the leaderboard then.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> the names jumped all around if the players were tied

That's because the entire board gets redone every 0.1 seconds.
Which is pretty much pointless anyway.

Instead, only update the value that changed, in the trigger that actually changes it.
 

SnowCrow

New Member
Reaction score
7
Instead, only update the value that changed, in the trigger that actually changes it.
I don't quite understand how to do this. Could you do me an example trigger?

But I've modified the leaderboard a lot, and its working all good, except that the players' names go wiuwiuwiu if they have the same score.
Here it is:
Code:
Le Aderboardette
    Events
        Time - Every 0.25 seconds of game time
    Conditions
    Actions
        Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Player1Score
        Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to Player2Score
        Leaderboard - Change the value for Player 3 (Teal) in (Last created leaderboard) to Player3Score
        Leaderboard - Change the value for Player 4 (Purple) in (Last created leaderboard) to Player4Score
        Leaderboard - Change the value for Player 5 (Yellow) in (Last created leaderboard) to Player5Score
        Leaderboard - Change the value for Player 6 (Orange) in (Last created leaderboard) to Player6Score
        Leaderboard - Change the value for Player 7 (Green) in (Last created leaderboard) to Player7Score
        Leaderboard - Change the value for Player 8 (Pink) in (Last created leaderboard) to Player8Score
        Leaderboard - Change the value for Player 9 (Gray) in (Last created leaderboard) to Player9Score
        Leaderboard - Change the value for Player 10 (Light Blue) in (Last created leaderboard) to Player10Score
        Leaderboard - Change the value for Player 11 (Dark Green) in (Last created leaderboard) to Player11Score
        Leaderboard - Change the value for Player 12 (Brown) in (Last created leaderboard) to Player12Score
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order
        If ((Player 1 (Red) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 1 (Red) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 2 (Blue) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 2 (Blue) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 3 (Teal) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 3 (Teal) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 4 (Purple) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 4 (Purple) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 5 (Yellow) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 5 (Yellow) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 6 (Orange) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 6 (Orange) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 7 (Green) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 7 (Green) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 8 (Pink) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 8 (Pink) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 9 (Gray) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 9 (Gray) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 10 (Light Blue) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 10 (Light Blue) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 11 (Dark Green) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 11 (Dark Green) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 12 (Brown) slot status) Equal to Is unused) then do (Leaderboard - Remove Player 12 (Brown) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 1 (Red) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 1 (Red) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 2 (Blue) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 2 (Blue) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 3 (Teal) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 3 (Teal) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 4 (Purple) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 4 (Purple) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 5 (Yellow) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 5 (Yellow) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 6 (Orange) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 6 (Orange) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 7 (Green) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 7 (Green) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 8 (Pink) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 8 (Pink) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 9 (Gray) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 9 (Gray) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 10 (Light Blue) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 10 (Light Blue) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 11 (Dark Green) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 11 (Dark Green) from (Last created leaderboard)) else do (Do nothing)
        If ((Player 12 (Brown) slot status) Equal to Has left the game) then do (Leaderboard - Remove Player 12 (Brown) from (Last created leaderboard)) else do (Do nothing)
A lot of text, but I think its the only way.

Code:
Imadoofus
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players) titled Score
        Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label (Name of Player 1 (Red)) and value 0
        Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label (Name of Player 2 (Blue)) and value 0
        Leaderboard - Add Player 3 (Teal) to (Last created leaderboard) with label (Name of Player 3 (Teal)) and value 0
        Leaderboard - Add Player 4 (Purple) to (Last created leaderboard) with label (Name of Player 4 (Purple)) and value 0
        Leaderboard - Add Player 5 (Yellow) to (Last created leaderboard) with label (Name of Player 5 (Yellow)) and value 0
        Leaderboard - Add Player 6 (Orange) to (Last created leaderboard) with label (Name of Player 6 (Orange)) and value 0
        Leaderboard - Add Player 7 (Green) to (Last created leaderboard) with label (Name of Player 7 (Green)) and value 0
        Leaderboard - Add Player 8 (Pink) to (Last created leaderboard) with label (Name of Player 8 (Pink)) and value 0
        Leaderboard - Add Player 9 (Gray) to (Last created leaderboard) with label (Name of Player 9 (Gray)) and value 0
        Leaderboard - Add Player 10 (Light Blue) to (Last created leaderboard) with label (Name of Player 10 (Light Blue)) and value 0
        Leaderboard - Add Player 11 (Dark Green) to (Last created leaderboard) with label (Name of Player 11 (Dark Green)) and value 0
        Leaderboard - Add Player 12 (Brown) to (Last created leaderboard) with label (Name of Player 12 (Brown)) and value 0
        Leaderboard - Show (Last created leaderboard)
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order

And here is one of the death triggers that add the score:
Code:
Death 1
    Events
        Unit - A unit owned by Player 1 (Red) Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Killing unit) is A Hero) Equal to True
    Actions
        If ((Owner of (Killing unit)) Equal to Player 2 (Blue)) then do (Set Player2Score = (Player2Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 3 (Teal)) then do (Set Player3Score = (Player3Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 4 (Purple)) then do (Set Player4Score = (Player4Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 5 (Yellow)) then do (Set Player5Score = (Player5Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 6 (Orange)) then do (Set Player6Score = (Player6Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 7 (Green)) then do (Set Player7Score = (Player7Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 8 (Pink)) then do (Set Player8Score = (Player8Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 9 (Gray)) then do (Set Player9Score = (Player9Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 10 (Light Blue)) then do (Set Player10Score = (Player10Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 11 (Dark Green)) then do (Set Player11Score = (Player11Score + 2)) else do (Do nothing)
        If ((Owner of (Killing unit)) Equal to Player 12 (Brown)) then do (Set Player12Score = (Player12Score + 2)) else do (Do nothing)
        Set Player1Score = (Player1Score - 1)
        Game - Display to (All players) for 7.00 seconds the text: (((Name of (Owner of (Killing unit))) +  just slaughtered ) + ((Name of (Owner of (Dying unit))) + !))

Then there is a victory trigger, which works fine.
So how to make the names not jump around?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top