• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Leaderboard - Kills

Status
Not open for further replies.
Level 8
Joined
Oct 31, 2010
Messages
238
Test map attached.

Of course, you need to modify the LB if there are more than one players.
The map i attached is for Demo purposes only.

  • Create LB
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Kills
      • Leaderboard - Show (Last created leaderboard)
      • Set LB_Kills = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Kills: and value 0
  • Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set Kills = (Kills + 1)
      • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Kills
 

Attachments

  • Leaderboard.w3x
    13.6 KB · Views: 62
Last edited:

sPy

sPy

Level 21
Joined
Apr 10, 2009
Messages
268
Test map attached.

Of course, you need to modify the LB if there are more than one players.
The map i attached is for Demo purposes only.

  • Create LB
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Kills
      • Leaderboard - Show (Last created leaderboard)
      • Set LB_Kills = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Kills: and value 0
  • Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set Kills = (Kills + 1)
      • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Kills

Why can't you just do this..?

  • Create LB
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Kills
      • Leaderboard - Show (Last created leaderboard)
      • Set LB_Kills = (Last created leaderboard)
      • For each (Integer 1 to 12), do actions
        • Loop - Actions
          • Leaderboard - Add Player(Integer A) to (Last Created leaderboard) with label Kills: and value 0
  • Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set Kills = (Kills + 1)
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills
 
Level 8
Joined
Oct 31, 2010
Messages
238
Why can't you just do this..?

  • Create LB
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Kills
      • Leaderboard - Show (Last created leaderboard)
      • Set LB_Kills = (Last created leaderboard)
      • For each (Integer 1 to 12), do actions
        • Loop - Actions
          • Leaderboard - Add Player(Integer A) to (Last Created leaderboard) with label Kills: and value 0
  • Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set Kills = (Kills + 1)
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills

You can do that.. And I said:
Only for demo purposes...
 
Level 8
Joined
Oct 31, 2010
Messages
238
Here this is a better one.


  • Create
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Leaderboard - Create a leaderboard for (Player group((Player((Integer A))))) titled Kills
          • Set LB[(Integer A)] = (Last created leaderboard)
          • Leaderboard - Add (Player((Integer A))) to LB[(Integer A)] with label Kills and value 0
          • Leaderboard - Show LB[(Integer A)]
  • Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) is 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 (Player((Player number of (Owner of (Killing unit))))) in LB[(Player number of (Owner of (Killing unit)))] to Kills[(Player number of (Owner of (Killing unit)))]
 

Attachments

  • LB.w3x
    17.4 KB · Views: 56
Level 3
Joined
Oct 15, 2010
Messages
51
Can someone type how to acquire the Nickname of the owner on the leaderboard ? :)
 
Level 13
Joined
May 11, 2008
Messages
1,198
in dota, you get a kill count how many times you killed certain heroes. but you only see that part at the end game scoreboard. in the map i'm developing, i'm planning to have the regular scoreboard show that. it won't show a whole lot else, though. so far i got hero icons and revival timers on there, and that's it
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
I know multiboards, don't know leaderboards, tbh.

Multiboards have more uses, but there's a place for a leaderboard. >.>
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Not really.

Leaderboards positions change according to who's the leader. they can only have two columns also. Name and whatever it is you are tracking.

I mean, it does certainly have it's uses (I planned to use one in a twisted metal game I gave up on a while ago), but Multiboards also have theirs.
 
Level 8
Joined
Oct 31, 2010
Messages
238
Well, I know both leaderboards and multiboards and are quite good in them.:)
Not say I mastered them..
Anyways Multiboards columns and rows are like X and Y axis on a graph.
If 1 Column, Its X=1, the vertical straight line
If 1 Row, Its Y=1, the horizontal straight line.

So you need a little bit of knowledge of coordinates to work out multiboards.
Best thing to do is have a plan on paper. Draw out the columns and rows.

So for example for a multiboard that show kills, what I will have is 2C, 1R.


C1C2
R1Kills:0

Without the guide, we have ...

Kills:
0

And I think this is a good tutorial to start with (If you haven't started with MBs yet)

http://world-editor-tutorials.thehelper.net/multiboard.php
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
what are you talking about x,y o_O

I don't see where coordinates come into play with multiboards.
 
Level 8
Joined
Oct 31, 2010
Messages
238
what are you talking about x,y o_O

I don't see where coordinates come into play with multiboards.

If you know your coordinate geometry in mathematics well..
Then

I have this table

Kills:
0

So you want to update the kills on the MB, but you dont get this..
  • Multiboard - Set the text for (udg_Kills_MB) item in column x, row y to (udg_Kills_Int)
You don't know what to set for column x and row y.
The coordnate for '0' in the table:

Kills:
0
is (2,1)

2 being the X (Column) and 1 being the Y (Row)

So you can just put the coordinate into

  • Multiboard - Set the text for (udg_Kills_MB) item in column 2, row 1 to (udg_Kills_Int)
Get it now?
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Oh, that was how you meant it.

I suppose I take such sense for granted. It only makes sense to me. no x,y required.

COLUMNS represent up-down direction, x if you will. ROWS refer to a horizontal direction, or y and the way I always remember that is Columns go from floor to ceiling. and you have rows of chairs on the ground.

Anyway, I never put it into coordinate terms, because of this understanding of mine.
 
Level 13
Joined
May 11, 2008
Messages
1,198
rows and columns sometimes do make more sense than that x and y stuff, which jboard helps with. both my maps are using jboard, and i recommend it to anyone. it's much easier to use for the multiboard than anything i've come across.

i found myself tripping up trying to use multiboards in jass, and if you use it in gui, it takes forever to redesign it once you've made it. if you need a look at jboard, just check out one of my maps from my signature. it allows me to easily design a multiboard and update it. i think it would be easy for other people as well.

at any rate, if you need a leaderboard, jboard won't help you since it's only for multiboards.
like mentioned above, leaderboards are used primarily for displaying who's in the lead, as in, who's on top of the game, etc. it's most appropriate for point based games. if your scoreboard is a leaderboard it should generally mean that by the time the game is over, the person at the top of the board is the winner. if it's a multiboard then who is at the top of the board is irrelevant. although it might normally be player 1. of course, if you are using a multiboard you could make a player have a column instead of a row...but that seems a little strange to most, i would imagine. probably the biggest reason for that would be that you normally put in a player name, which is written sideways. if you made a player have his own column it would up being a fat column if you entered his name into it. that would be inefficient.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Well, regardless of this jboard thing, I, and probably the OP as well, don't use Jass, so it's not useful for us.

Although I do believe that you could make a complex multiboard system that under certain conditions would change to put the player which met said conditions (like points) above those who have lesser qualifications. I have not tried such a process, but I would think it to be possible. You'd just need a LOT of multiboards.

One for each possibility, which would rise exponentially for every player you add to the game. I would think it's POSSIBLE, just not probable to do this. Which is where Leaderboards come in, :D
 
Level 13
Joined
May 11, 2008
Messages
1,198
well, if you looked at my use of jboard in my maps, you can see that jboard offers an alternate interface with the jass multiboard. it basically lets you set up the multiboard and modify it as the game progresses with great ease.

regular functions are available, such as:
Code:
method setWidth takes real w returns nothing
set .width = w
call MultiboardSetItemWidth(.mbi,w)
endmethod

method showIcon takes nothing returns nothing
set .showI = true
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod

method hideIcon takes nothing returns nothing
set .showI = false
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod

method showValue takes nothing returns nothing
set .showV = true
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod

method hideValue takes nothing returns nothing
set .showV = false
call MultiboardSetItemStyle(.mbi,.showV,.showI)
endmethod

method setIconPath takes string s returns nothing
set .iconpath = s
call MultiboardSetItemIcon(.mbi,.iconpath)
endmethod

and other functions, too, are available, such as:
Code:
method add takes integer i returns nothing
set .content = I2S(S2I(.content) + i)
call .updateField()
endmethod

method setValue takes string s returns nothing
set .content = s
call .updateField()
endmethod

method setPrefix takes string s returns nothing
set .prefix = s
call .updateField()
endmethod

method setSuffix takes string s returns nothing
set .suffix = s
call .updateField()
endmethod

method setColour takes string rgb returns nothing
set .colour = rgb
call .updateField()
endmethod

there are even getters:
Code:
method getValue takes nothing returns string
return .content
endmethod

method getPrefix takes nothing returns string
return .prefix
endmethod

method getSuffix takes nothing returns string
return .suffix
endmethod

method getColour takes nothing returns string
return .colour
endmethod

method getWidth takes nothing returns string
return R2S(.width)
endmethod

method getIconPath takes nothing returns string
return .iconpath
endmethod
you could do something like setting the width and text(and icon, etc) in the same line:
Code:
call jBoard_TAF.field(2,3).setValue("< Revival Timers >").setWidthR(0.10)
it basically allows you to type less stuff to get more work done.
alternatively, you could set the width for an entire column in a single line, instead of putting it at the end of the call for every row of that column:
Code:
call jBoard_TAF.col(3,3).setWidthR(0.10)
this is useful if you want wide or short columns, for example if you are using player names, or you want extra information attached to numbers, such as perhaps adding suffixes or prefixes to the values, which is easily manipulated with the jBoard system, making the multiboard look very professional with great ease.

also, you can edit the defaults to whatever you would like:
Code:
//! textmacro jBoardDefaults
        static string  defaultItemValue = "0"
        static string  defaultIconPath  = ""
        static boolean defaultShowValue = true
        static boolean defaultShowIcon  = true
        static boolean defaultShowBoard = true
        static real    defaultItemWidth = 0.03
//! endtextmacro

IMPORTANT NOTE: there was a bug with jBoard, i fixed it, but there is one more that remains, i guess. that is:
Code:
        static string  defaultIconPath  =
doesn't work. i might fix it soon, though(if i can), as it's kindof annoying me, right now.

edit: oh, here we go, it was just a matter of fixing the init function:
Code:
method initBoard takes nothing returns nothing
call MultiboardSetItemsValue(.MB,.defaultItemValue)
call MultiboardSetItemsIcon(.MB,defaultIconPath)
call MultiboardSetItemsStyle(.MB,.defaultShowValue,.defaultShowIcon)
call MultiboardSetItemsWidth(.MB,.defaultItemWidth)
call MultiboardDisplay(.MB,.defaultShowBoard)
endmethod
 
Last edited:
Level 17
Joined
Apr 3, 2010
Messages
1,101
Well, regardless of this jboard thing, I, and probably the OP as well, don't use Jass, so it's not useful for us.

Although I do believe that you could make a complex multiboard system that under certain conditions would change to put the player which met said conditions (like points) above those who have lesser qualifications. I have not tried such a process, but I would think it to be possible. You'd just need a LOT of multiboards.

One for each possibility, which would rise exponentially for every player you add to the game. I would think it's POSSIBLE, just not probable to do this. Which is where Leaderboards come in, :D

Naw u dont need multi multi board You only need 1 all that you do is have condition. And player number to order it I.e

Rank Player Gold Wood Food Exp score Etc>

1 xxx xxx xxx xxx xxx xxx
2 xxx xxx xxx xxx xxx xxx
3 xxx xxx xxx xxx xxx xxx
4 xxx xxx xxx xxx xxx xxx
5 xxx xxx xxx xxx xxx xxx
6 xxx xxx xxx xxx xxx xxx
7 xxx xxx xxx xxx xxx xxx
8 xxx xxx xxx xxx xxx xxx
9 xxx xxx xxx xxx xxx xxx
10 xxx xxx xxx xxx xxx xxx

Once you have that basis set up you can just update it via.
You can do a table which you can do via conditions Pick all players in Playergroupx Set Playerrank (Number of picked player-1) = 10
If Picked x greater than picked x and Set Playerank (number of picked player-1) = Playerrank (Number of picked player-1)-1.
This creates a countdown. So the player with highest score will end up with 1 rank after beating 9 players.



Or you can do long hand table


player number
Player number 1 2 3 4 5 6 7 8 9 10
1 x
2 xxx
3 xxxx Etc
4
5
6
7
8
9
10
If you want to put in that perspective we have basically now just done that table and checked each one of but not checked 1 against 1


The 2nd trigger is to now set the update corresponding so

Pick everyplayer in player group x
If playerrank (number of picked player equal) to 1 then set column 2 row 1 = matching player. Set Playergold Column X Row X .matching player
If Column count <x Set columncount + 1 Row+1
Then Set columncount + 1 columnx +1 Rowx +1
Else Set Columncount =0
Set columnx= Column x +1
Or somin like that. Then you can repeat If Player rank numof pickplayer = to 2 Then set column 2 row 1.
Thus it creates the rank sets the leader. It then allows via checking which rank is which to set each player and there stats. As the player rank is set from 1-10. So if pickplayed = to say blue(player 2) who has highest score. It will register Blue as Rank 1 So if Playerrank (2 (Blue)) = 1 Then set Column x Row x . Stat (Number of matching player) Etc So (Set Row 2 Column 2 Gold 1000. Also everytime that Column count reaches your number of rows when it is <x not lower than x so if it is x or higher. Then It will go onto next column and start to fill out stats.

If this does not explain it enougth for you i can make a test map to show you.
But yet again its a reason why Multiboard Are alltogether better than Leadboards. Leaderboards Are used because they are quick and easy to make to show 1 Statistic Like if your map only had player and score. While multiboards are used to show multiple statistics and therefore are more useful.
Hope this helped.

Btw This does not include the Temp_Group u would have to set to remove leak
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
Oh. So jBoard is just like a normal GUI Multiboard.. Except that it can do more work more easily in a shorter time?

And can jBoard allow us to have more than 16 Columns and 32 Rows?

lol, haven't tried using that many...but yes, i just tested, and it does appear to work to have no limit...although obviously people have screen size limits...

suppose you make a library that includes colors used for your text messages. i made my own text message system for my map...well, in addition to the colored text variables...you would make jboard colored text variables.
for example: constant string jB_aqua="00ffff"
then that explains the simple code:
call jBoard_TAF.field(0,3).setColour(jB_aqua).setValueR(GetPlayerName(Player(2)))
that was a less than obvious thing since jB_aqua in my map is in the trigger MSGS and not in either of the mb triggers.
other than that, mostly things should be self-explanatory, but since reading a lot of jass may well be new to many gui users, feel free to hit me with any other questions about it.
 
Last edited:
Status
Not open for further replies.
Top