How do I "Facebook Top 10 Scores"

Get help using Construct 2

Post » Thu May 01, 2014 9:11 pm

Message: isasaurio can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hello friends
I want to implement the game FLAPPING BIRD, so that you can play with Facebook (that I want to apply to a future game).
Achieve Logging publish Score and publish on the wall.
What we can do is to display the "Leader Board".
Like what I do?
Also I want to finish the game displays a list of the top 10 scores somethings, each with its name.
The idea is to have a contest and to be aware of who is having the No. 1 spot.
I searched for tutorials but I have not given anything.
Can you help me please, as I see that there is no information.
This is the link of the game
http://www.puzzlenegro.cl/PZNGAME/

-----------------------------------------
Hola amigos
Quiero implementar el juego FLAPPING BIRD, para que se pueda jugar con Facebook (esto lo quiero aplicar a un futuro juego).
Logre el Logging, publicar Score y publicar en el muro.
Lo que no puedo hacer es lograr visualizar el “Leader Board”.
Como lo debo hacer?
Quisiera también que al finalizar el juego se muestre una lista con los 10 puntajes más algos, cada uno con su nombre.
La idea es hacer un concurso y poder estar al tanto de quien es el que tiene el puesto número 1.
He buscado tutoriales pero no he dado con nada.
Me pueden ayudar por favor, ya que veo que no existe información al respecto.

Este es el Link del juego
http://www.puzzlenegro.cl/PZNGAME/
B
42
S
9
G
2
Posts: 111
Reputation: 3,723

Post » Fri May 02, 2014 6:33 am

Hi isasaurio,

I'm also looking for the same solution.
You can use: "Request hi-score board", from Facebook object. When you use this, you can also specify the number of top scores you want. So if you set the number to 10, we should get the top 10 scores. Please note: This will work only if user has given the "publish scores" permission.

This much, I could understand from the Manual. But I don't know how to display the Array response from Facebook.
I'll crack this today and let you know if I am successful.

Please note: There are some major changes to permissions from Facebook. This happened with new version release on 30th April 2014. It'll be helpful to review them.

Cheers,
Capper
B
7
S
1
Posts: 15
Reputation: 465

Post » Fri May 02, 2014 1:00 pm

Hi,

I have got a working solution. This will work only for leaderboard among friends. It will not show a world-wide leaderboard. This is because, if the call for scores is initiated from user, Fb will give only the user's friend's scores.

I think clay.io plugin should help if you want world wide leaderboard. Please check this tutorial if it helps:
https://www.scirra.com/tutorials/495/how-to-make-a-custom-leaderboard-and-more-using-clay

I haven't used clay.io, but, I store every user's score on my server and display the world leaders on a separate page.

Attached screenshot of events sheet.
Logic:
Create arrays to store High score data (I have used 2 arrays - one for name and one for score)
Create global variable for Array indexing. ('i" in my example)
1. Call "Request hi-score board"
2. Set the number of scores you need - 10 in my example
3. Use "On hi-score" to populate the arrays. Note that "On hi-score" is triggered once for each score record received. Hence if you ask 10 scores it will be triggered 10 times. For each trigger we are incrementing the index (i) and storing the data in the respective arrays.
4. After that we display the scoreboard in different text boxes. I used 20 of them.

IMPORTANT CHANGES TO BE MADE TO c2runtime.js
1. In FB.init add "Version": "v2.0",
2. js.src link change all.js --> sdk.js
3. RequestHiscores function def add '/v2.0/' after FB.api(
4. You have to update "channel.html" with point 2

These are for changes due to Facebook platform upgrade.
I have attached screenshots to illustrate all these points.

Possible improvements:
I think one array could be used... maybe
2. all the fb related changes may not be necessary

Food for thought....
If you have less than 10 friends who have played, then "On hi-scores" will be triggered exactly for the number of players only. It will not trigger all the times. So the array will be filled partially. (to be explored: What if we have more than 10 friends and we want to dynamically display the exact number of friends who play the game???) :?:



Let me know if this helped.
I'll be glad, if some experts can offer tips on optimizing what i've done.


Cheers,
Capper
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 15
Reputation: 465

Post » Sat May 03, 2014 1:28 am

Message: isasaurio can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
vishymuku wrote:Hi,

I have got a working solution. This will work only for leaderboard among friends. It will not show a world-wide leaderboard. This is because, if the call for scores is initiated from user, Fb will give only the user's friend's scores.

I think clay.io plugin should help if you want world wide leaderboard. Please check this tutorial if it helps:
https://www.scirra.com/tutorials/495/how-to-make-a-custom-leaderboard-and-more-using-clay

I haven't used clay.io, but, I store every user's score on my server and display the world leaders on a separate page.

Attached screenshot of events sheet.
Logic:
Create arrays to store High score data (I have used 2 arrays - one for name and one for score)
Create global variable for Array indexing. ('i" in my example)
1. Call "Request hi-score board"
2. Set the number of scores you need - 10 in my example
3. Use "On hi-score" to populate the arrays. Note that "On hi-score" is triggered once for each score record received. Hence if you ask 10 scores it will be triggered 10 times. For each trigger we are incrementing the index (i) and storing the data in the respective arrays.
4. After that we display the scoreboard in different text boxes. I used 20 of them.

IMPORTANT CHANGES TO BE MADE TO c2runtime.js
1. In FB.init add "Version": "v2.0",
2. js.src link change all.js --> sdk.js
3. RequestHiscores function def add '/v2.0/' after FB.api(
4. You have to update "channel.html" with point 2

These are for changes due to Facebook platform upgrade.
I have attached screenshots to illustrate all these points.

Possible improvements:
I think one array could be used... maybe
2. all the fb related changes may not be necessary

Food for thought....
If you have less than 10 friends who have played, then "On hi-scores" will be triggered exactly for the number of players only. It will not trigger all the times. So the array will be filled partially. (to be explored: What if we have more than 10 friends and we want to dynamically display the exact number of friends who play the game???) :?:



Let me know if this helped.
I'll be glad, if some experts can offer tips on optimizing what i've done.


Cheers,
Capper




Thank you very much friend, I will put into practice and tell you how it goes.

Thank you
B
42
S
9
G
2
Posts: 111
Reputation: 3,723

Post » Tue May 06, 2014 2:54 am

I exported my game to Windows 8, but when I try to use the Facebook object it says:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed

Do you know how to fix this?
Image
B
15
S
4
G
4
Posts: 134
Reputation: 3,177

Post » Tue May 06, 2014 3:19 am

you need to set as the "FROM FACEBOOK" as a "APPLICATION FOR WINDOWS".
B
42
S
9
G
2
Posts: 111
Reputation: 3,723

Post » Tue May 06, 2014 3:41 am

Yes, I have done it, I also set the Windows Store ID on the Facebook App, I still get that error
Image
B
15
S
4
G
4
Posts: 134
Reputation: 3,177

Post » Wed Sep 24, 2014 11:56 am

@vishymuku can you provide .capx file? thanks
B
16
S
4
Posts: 52
Reputation: 1,219

Post » Fri Oct 03, 2014 1:33 pm

@isasaurio have you done with fb plug in . could you please let me know where i can get IMPORTANT CHANGES TO BE MADE TO c2runtime.js
1. In FB.init add "Version": "v2.0",
2. js.src link change all.js --> sdk.js
3. RequestHiscores function def add '/v2.0/' after FB.api(
4. You have to update "channel.html" with point 2


above file to edit?

thanks
B
16
S
4
Posts: 52
Reputation: 1,219


Return to How do I....?

Who is online

Users browsing this forum: Aenopix and 2 guests