I am looking to end the game with the player who has the most points on a leaderboard that I created.
I made a timer and I made a leaderboard. Now i was trying to do something like, when the timer ends the player with the most points on my leaderboard is the winner. I cant seem to figure out how to reference my leaderboard text values.
disclaimer: I don't use the leaderboard Blizzard provided, so this is mere speculation.
Text values can't be used in conditions (comparisons). They can be used as functions in actions, though. A quick glance at the leaderboard actions reveals that you can only set text values, so I'm assuming there's no way to retrieve score information from leaderboards (directly).
Anyway, unless you already have the scores stored apart from the leaderboard, you'd have to use whatever the leaderboard is using for score at the end to determine who has the highest score. (Simple way of doing that is a really big max-int chain).
Why don't you use integer arrays for score, then update the leaderboard to whatever those variables are? Then you can just reference the value of the integer values when determining the winner.
Your response triggered something in my head that I should have been doing...
I have been storing my leaderboard numbers on a variable integer array, which is called points for all players.
So i basically did in conditions Points[1] > Points [2].... Points [1] > Points [3] and so on.
Here would be my approach:
define highest = 0
define player = 0
General: Pick each integer from 1 to 8 <--- This would be the number of players in the array
if
points[picked integer] > highest
then
highest = points[picked integer]
player = picked integer
After the iteration, use player to give the victory condition.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am looking to end the game with the player who has the most points on a leaderboard that I created.
I made a timer and I made a leaderboard. Now i was trying to do something like, when the timer ends the player with the most points on my leaderboard is the winner. I cant seem to figure out how to reference my leaderboard text values.
@baca25: Go
Text values can't be used in conditions (comparisons). They can be used as functions in actions, though. A quick glance at the leaderboard actions reveals that you can only set text values, so I'm assuming there's no way to retrieve score information from leaderboards (directly).
Anyway, unless you already have the scores stored apart from the leaderboard, you'd have to use whatever the leaderboard is using for score at the end to determine who has the highest score. (Simple way of doing that is a really big max-int chain).
Why don't you use integer arrays for score, then update the leaderboard to whatever those variables are? Then you can just reference the value of the integer values when determining the winner.
Your response triggered something in my head that I should have been doing...
I have been storing my leaderboard numbers on a variable integer array, which is called points for all players. So i basically did in conditions Points[1] > Points [2].... Points [1] > Points [3] and so on.
Too many triggers, I am losing my sanity.
Welcome to my life :P
Here would be my approach:
define highest = 0
define player = 0
General: Pick each integer from 1 to 8 <--- This would be the number of players in the array
if
points[picked integer] > highest
then
highest = points[picked integer]
player = picked integer
After the iteration, use player to give the victory condition.