00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Edits to post #27097993 by RaIix

Edited

Oh yeah, I remember this.


It says the default limit is 10…

iu_472875_4428769.png


…but what it actually sends when you don't set it yourself is zero.

iu_472876_4428769.png


So you're actually getting the best “0” scoreboard entries.


Set the limit to something reasonable, and it should be okay.

public void LoadScore(string period)
{
    var getScores = new io.newgrounds.components.ScoreBoard.getScores();
    getScores.id = thenumber;
    getScores.period = period;
    getScores.social = false;
    getScores.limit = 25;
    getScores.callWith(ngioCore, OnScoresLoaded);
}


Also, you probably want to display the username rather than the "object" itself, so you need to get the name:

text += $" – {score.user.name} {score.value}";


Otherwise, you end up with this:

iu_472877_4428769.png


At 11/14/21 11:19 AM, Dsiak wrote: The upload score is working fine but the in game score display is broken, can someone review my code and see what could possible be wrong? Thanks in advance.


Oh yeah, I remember this.


It says the default limit is 10…

iu_472875_4428769.png


…but what it actually sends when you don't set it yourself is zero.

iu_472876_4428769.png


So you're actually getting the best “0” scoreboard entries.


Set the limit to something reasonable, and it should be okay.

public void LoadScore(string period)
{
    var getScores = new io.newgrounds.components.ScoreBoard.getScores();
    getScores.id = thenumber;
    getScores.period = period;
    getScores.social = false;
    getScores.limit = 25;
    getScores.callWith(ngioCore, OnScoresLoaded);
}


Also, you probably want to display the username rather than the "object" itself, so you need to get the name:

text += $" – {score.user.name} {score.value}";


Otherwise, you end up with this:

iu_472877_4428769.png