How do i take best score from clay.io and post on screen

Get help using Construct 2

Post » Sun Apr 27, 2014 6:42 pm

How do i take best score from clay.io leader board and post on specific area. like i have made text area for that.
B
12
S
2
Posts: 76
Reputation: 930

Post » Mon Apr 28, 2014 4:26 am

Nobody knows that or nobody wants to help?
B
12
S
2
Posts: 76
Reputation: 930

Post » Mon Apr 28, 2014 8:36 pm

If they don't know why would they answer? Do you really want a bunch of replies saying "I don't know"? Isn't that very counter intuitive? If someone who knows sees this, maybe they will respond.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Tue Apr 29, 2014 6:54 am

@bluephaze True my friend. But how come nobody has implemented this so far?
B
12
S
2
Posts: 76
Reputation: 930

Post » Tue Apr 29, 2014 12:40 pm

@ashar, it's quite easy to do once you know how. I'll have a look on my PC later and let you know if no one else chimes in first. Have a look at the load leaderboard function in the plugin and the documentation on the clay website - I don't recall of it was explicitly described there but you might be able to figure it out before I get access to my last game that used it. LD29 has taken over my life hence the slow reply...
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Tue Apr 29, 2014 2:39 pm

Plenty of people may have implemented it, but you have to hope out of the percentage that have used it, a percentage of those hopefully see this discussion thread.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Tue Apr 29, 2014 2:44 pm

OK, first of all there are a couple of excellent tutorials that you should read before trying this (if you haven't done so already):

integrating leaderboards... by austin
how to make custom leaderboard by CanGame

It is also worth bookmarking the clay.io manual page for construct 2 here. Austin has done an outstanding job at not only creating the plugin but also documenting how to use it.

Now for the direct answer that you are after:

After posting the high score to clay.io, create an event to retrieve the leaderboard object, which will then be remembered by the plugin. You could easily show the top 10 scores this way as shown in the custom leaderboard tutorial above. The top score is contained at index 0 of the leaderboard - your event should look like this:

Image

You also have the option to specify downloading the Personal leaderboard for the player, so you could choose to give them some banter as to why they haven't beaten their previous high score...
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Tue Apr 29, 2014 5:54 pm

@Colludium Thank you so much. I tried it. But problem is with plugin i guess. When i select "PERSONAL" from clay.io plugin drop down menu in "Fetch Leaderboard Object" then it shows NaN. When i chose "ALL" or other options then it shows :(
B
12
S
2
Posts: 76
Reputation: 930

Post » Tue Apr 29, 2014 6:42 pm

@ashar - that's a pity. I haven't tried it in a game myself so it could be the plugin is at fault. Just to be sure, could you share screen shots of the dialog boxes / capx to see if it's a code error?
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Tue Apr 29, 2014 7:44 pm

@Colludium Yes please help me out. Its a zip file.
Last edited by ashar on Sun May 11, 2014 12:47 pm, edited 1 time in total.
B
12
S
2
Posts: 76
Reputation: 930

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo and 32 guests