Leaderboard for C3

0 favourites
  • 15 posts
From the Asset Store
A small template showing how to build a firebase ranking
  • Hello, I'm looking for someone who can help me integrate a leaderboard for my game. I created a new project with Firebase and here is my code (inspired tutorials on youtube): unfortunately, it does not work as a first test. The score does not change and the login window for google does not want to open with C3 (I'm using rex's plugins for C3 : FirebaseAPIv3, LeaderBoard and Authentification)

    Thanks !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the login window for google does not want to open with C3

    Add "https://preview.construct.net" to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.

    and turn on "login with google".

  • Thanks a lot ! Now I need to know why is this submit button not working... haha

  • Anyone know why my submit button does not want to show me the score as in a leaderboard? (the blue area selected on the second screen is my txt_scoreboard)

  • Up ! :)

  • Did you create a leaderboard key?

    if not exists create.

    and change to your database rules.

    {
     "rules": {
     "Leaderboard": {
     ".read": true,
     "$uid": {
     ".read": "$uid === auth.uid",
     ".write": "$uid === auth.uid"
     }
     }
     }
    }
    
  • I did what you said for the database rules, and now the submit button is working but I have to click several times on it in order to see the results.

    For the leaderboard key, I don't know what it is, but my database seems empty :

  • check it id name.

    should be your key name same as the id name.

  • But I can't change my ID project now.. do you have discord or something like that in order to communicate fastly ? Thanks in advance !

  • Up :s

  • Be sure to create the database "LeaderBoard" key.

    open the developer console and check errors.

    I have no other idea.

  • To summarize, the first time I run the test, that I click on the button score and then submit, it works and it shows me the good score. Then, when I try to add another score by pressing the score button again and re-submit, there is nothing left and my first score is gone (it may be normal depending on the code). But when I try to submit by pressing 10 times in a row for example, after a while, I get this:

    Is it a bug?

    Here is also a preview of the console :

    Thanks for trying to help me anyway, I really appreciate that.

  • your database rules are blocking access to the database.

    write

    {
     "rules": {
     ".read": true,
     ".write": true
     }
    }
    

    for test.

    You can look here for more information.

    firebase.google.com/docs/database/security/quickstart

  • It works, thanks ! :)

    Please could you add "Legend Arena #5805" on discord if you have this software ? I'm struggling with some other points, it could be easier to speak than here (I can pay you if you help me finishing to integrate this test in my game)

  • HelloThomas_Collin!! In case you need help on Firebase, I recently had a tutorial published on this topic- where I'm using JavaScript...

    JavaScript makes it more flexible and all functions of Firebase can be used (like cloud storage).

    And this can also help you get started with any other API..

    Construct 3 & Firebase using JavaScript>> (This tutorial also includes- how to make a leaderboard)

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