Leaderboard place of player?

The end game device is for, well, when it’s over, but I want the players position to be shown in game.

2 Likes

Hey! What are you using to track score again?
Thanks for pinging me.

1 Like

I am using a property. (Called level for what level the player is on)
(No problem!)

1 Like

You’re gonna have to brute-force this one by making/simulating a new leaderboard. Or, you could allow the leaderboard to be visible in-game? I don’t know if that’s what you want though.

1 Like

It’s already visible in-game, but I want the player to know without checking what place they’re on.

1 Like

So you have to compare the level of each player to each others and rank it using text.

2 Likes

How would I compare those properties if they all use the same one?

1 Like

And make the scope equal to player!

1 Like

Yes, I know that, but they all use the same property and you can’t really compare two(taht are the same) properties correctly.

1 Like

No properties, variables. Make a new variable whenever the triggering player triggers a trigger which is triggered by a relay and compare them ti each other.

1 Like

Ok let me try that, thanks!

2 Likes

There are 2 ways of comparing player scoped properties that I know of: subtracting items and proxy properties. I’ll reply with the proxy property way later.

2 Likes

Can you give me more details on the wires and stuff?

1 Like

Here is the gist of this:
We will construct the leaderboard from the bottom up. We need a Num Players property. So we start with a global number property named “Current Lowest” (default 9999999999999999999999999999999999999) and another one named “Current Place”. Also make a player-scoped true/false property default false, named “Has Gone”.

So a relay broadcasts to each player and checks if their score is less than “Current Lowest”. If it is, it checks if “Has Gone” is false. If it is, it sets “Current Lowest” to their score, sets “Has Gone” to true, and it sets “Num Tie” to 1, more on that later. If the 2 scores are the same, it sets a global number property with a default of 1 that is named “Num Tie” to itself plus one.

Once everyone has gone (new relay channel), it sets the player’s place on the leaderboard, if the player’s score is equal to “Current Score”. More later.

3 Likes

you could probably use this block:
Screenshot 2023-09-19 6.35.20 PM
have a game overlay (type button) run a wire pulse block in a popup when the button is pressed,
then go into its blocks, (on wire pulse block) and use the “set text” block and connect it to the block in the picture. Make the popup open when receiving on a channel from when the button of the game overlay is pressed. This way, players can view their score anytime.

(me just realizing you said their place and not their score :person_facepalming:)

2 Likes

So, how do you want the leaderboard to be displayed?

1 Like

Through a game overlay.

1 Like

Did that make sense? I didn’t include specifics since I just wanted to get the idea through.

1 Like

I am testing it out right now.

1 Like

What is “Num Tie”?