I have a leaderboard that is made of dialogs (with images as portraits, etc)
How do you sort a dialog leaderboard by kills though?
Thanks in advance
What do you mean by sort the dialog by kills? Do you want to sort the kills into catagories, do you want to sort them by the type of unit killed, do you want to sort the by who has the most kills. A little light into what you are doing would be appreciated. :)
I'm watching you
Need Help with dialogs? Use Dialogception
Since it's a dialog, and not an actual leaderboard element, you'll have to re-populate the dialog every time you want it updated.
So the loop that you use to fill out all the variable values, you'll want to run that again with the new order of players based on current kills.
That sounds like a lot of updating to me though.
You're going to need to do a bubble sort against parallel arrays (one array holding kills, another holding the player Ids) and then update your dialog accordingly.
yea to clarify what i want is the player with most kills on the top slot, player with the 2nd amount of kills in the 2nd slot etc,
What is bubble sort? what are the actions i should use to actually sort the amount of kills?
essentially you need to run a periodic check that sorts the players on kills into the correct order, here i'll work on an example map for you.
When players are tied for kills it will go with the highest numbered player.
going try it out right now! :)
from the example map, how would you find the specific "rank" for each player?
for example, player 1(red) has most kills, so he is at the top of the leaderboard, and I want to display a big "#1" on his screen
if he is in 2nd place, then a dialog would display a big "#2" on his screen
is there anyway to get the "rank #" for that player?
(i looked at the variables in the example map, and see a "rank variable" but it doesnt match up to the actual rank that the player is)
I displayed the "rank variable" in the debug, and doesnt always match up (player 1 has most kills and top of the leaderboard but the "rank variable" displays 4................posted screenshot)
Is there someway to return the actual rank of the player so I can display a dialog that shows a big "YOU ARE RANK #..."
like this? it seems to work for me?. check it out closely. make sure you understand the triggers if you don't just ask me.
yea i think i may have messed up somewhere with the active players/all players/and the general debug message lol
you are super awesome, thanks!
You must login to post a comment. Don't have an account? Register to get one!