FB Instant Games - Leaderboard

0 favourites
From the Asset Store
A small template showing how to build a firebase ranking
  • I have a global variable for a score in my game. And I created a Leaderboard for the game in Facebook Instant Game settings. (global not contextual) How do I translate that into a score on a Facebook Leaderboard?

    Can you or someone list the set of events to get the Leaderboard to work? or post a screenshot of their events? or copy/paste the events? or is there a tutorial written on this?

    Just read this thread, the events to load data is descibed here.

    To post is easier, not possible to fail sort of. You just enter the name of the leaderboard you have created in The FB app into the post event in construct.

    To have score as a variable is fine, that is pretty much the only way to have it...

    The leaderboard has good error messages if it wont work for some reason, just run your instant game in browser and look in the console what is happening.

    good luck

  • >

    > I have a global variable for a score in my game. And I created a Leaderboard for the game in Facebook Instant Game settings. (global not contextual) How do I translate that into a score on a Facebook Leaderboard?

    >

    > Can you or someone list the set of events to get the Leaderboard to work? or post a screenshot of their events? or copy/paste the events? or is there a tutorial written on this?

    >

    Just read this thread, the events to load data is descibed here.

    To post is easier, not possible to fail sort of. You just enter the name of the leaderboard you have created in The FB app into the post event in construct.

    To have score as a variable is fine, that is pretty much the only way to have it...

    The leaderboard has good error messages if it wont work for some reason, just run your instant game in browser and look in the console what is happening.

    good luck

    yep. I read through again and it had enough for me to set high score and create a leaderboard and also update messenger when player reaches a new high score. Now I just need to get the game approved and published so others can test it. Thanks!

  • For those that wanted a pre-made leaderboard, here is one I made:

    http://s000.tinyupload.com/index.php?file_id=72443483567597873242

    The leaderboard shows 10 players at a time. You can go to next / prev 10 players. There's also a button to view the top 10 players, and button to view your position in the leaderboard.

    It shows Player rank, score, name, and image.

    I can't give much support, but feel free to use it.

    To test it, just change the name of the leaderboard (mine is non-contextual), and upload the export to facebook, all submitted scores will show up. (note: I've only tested with a few players in the leaderboard)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • jagoman,

    There is a problem with this , i get the same image on all of leaderboard images ?

  • jagoman,

    There is a problem with this , i get the same image on all of leaderboard images ?

    This is resolved at event 18; It checked to see if the new user image is the same as the previous image, then it will hide the userImage.

  • jagoman

    you said sharing worked for you, or more like "invite", however its not working for me

    i am wondering if there is anything else to do other than what im doing

    i just add an action when button clicked, invite, chosen a random image, added text, empty data field

    i tried all 4 types of share and none worked for me

    what am i missing?

  • nlon

    Intent: Choose any, it doesn't matter (Facebook haven't decided what to do with that parameter yet)

    Image: Ensure whichever image you choose is on the project layout. The button won't work if it isn't (and no error message given)

    Data field: Mine is empty too

  • brilliant!! didnt think of that!

  • jagoman

    Hi,

    Your leaderboard file helped a lot.

    There is one thing am confused.

    We are able to get data of leaderboard players name,score,rank and photo using expressions.

    But for the connected players (assuming our friends).I am able to get rank, photo and name. but there is no expression for the score.

    Is there any way to get score of connected players. Or we have to wait for the plugin update?

    Thanks

  • aashcool07

    Great to hear it helped

    Sorry haven't looked into 'connected players' data

  • jagoman

    I was trying to make a nice leaderboard to show friends data also with score.

    Whenever you get time have a look once.

    I searched on forum also no thread about this.

    Thanks again!

  • jagoman

    I was trying to make a nice leaderboard to show friends data also with score.

    Whenever you get time have a look once.

    I searched on forum also no thread about this.

    Thanks again!

    There are absolutely no difference in showing the scores for the connected players than for the total global leaderboard. only difference is in the call.

  • fredriksthlm

    Thanks for replying.

    The thing is if i want to set the score of person who is at number one on leaderboard i use this in set text "InstantGames.LeaderboardScoreAt(0)" for rank number 2 "InstantGames.LeaderboardScoreAt(1)".

    If i want to set text of the connected player who is at rank number 1 or 2.

    What should i put in the action?

    Thanks

  • fredriksthlm

    Thanks for replying.

    The thing is if i want to set the score of person who is at number one on leaderboard i use this in set text "InstantGames.LeaderboardScoreAt(0)" for rank number 2 "InstantGames.LeaderboardScoreAt(1)".

    If i want to set text of the connected player who is at rank number 1 or 2.

    What should i put in the action?

    Thanks

    The same.

    The fetched data is stored the same way.

    It is the Load Leaderboard data you have to change, Results=Connected players.

  • It worked!

    Thanks a lot

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)