[PLUGIN] Clay.io (leaderboards & achievements)

From the Asset Store
Implement a customizable array-based achievement system with the fully-commented template.
  • Updated the tutorial, thanks for the heads up. If you ever run into issues like that, feel free to shoot me an email to see if it's something easy for me to diagnose.

  • austin, I found the "Always show Clay.io login box on load when a player isn't logged in" checkbox. I was focusing on Construct 2 and completely forgot about the settings menu in Clay.io

    Thanks again

  • What should be the correct way to login, post score, fetch leader board then?

    Here is what I have:

    To login:

    • On the start page, check if Clay.io is ready -> check if Clayio.LoggedIn = 0 -> Show Prompt Login.
    • On the submit score page:

    + If the player touches the submit score text -> submit score.

    I found out that if the player did not log in in the Start page, the Login window will show up here. That's fine. But it does not seem to remember the login info. If I logged in, then press the submit button again, then the login will still appear.

    • To fetch the leader board:

    + on start of layout -> fetch leaderboard.

    + when scores are fetched -> display.

    This only works when the player signed in from the start page, not from the Submit page. Is it required to log in to see the leader board?

  • Does Clayio work in CJS? I want make my game native one. I tried several times with CJS Launcher 1.4 but it didn't work. I followed the manual, getting some js files into zip...

  • Hi austin,

    I've been trying to add Clay.io into my windows phone project. I used the C2 tutorial 'Windows 8 and Clay.io Integration', for reference (as there don't seem to be any tutorials specifically for Clay.io + Win Phone integration).

    I've had some partial success, but the modal windows do not display correctly (see images below, img_number1 = log in modal, and img_number2 = scoreboard modal). As you can see, it doesn't look too good!

    Do you know if anyone has achieved successful Clay.io integration with Win Phone yet? If so, did they post any tips on the process?

    img_number1

    <img src="https://dl.dropboxusercontent.com/u/78057629/img_number1.jpg" border="0">

    img_number2

    <img src="https://dl.dropboxusercontent.com/u/78057629/img_number2.jpg" border="0">

    Thanks in advance for any advice you can offer.

  • Hey guys, love your work. I believe Clay.IO breaks the latest version of CocoonJS. I get the following error when adding the plugin to any project:

    JavaScript Exception: (File:'c2runtime.js' Tag:'script') TypeError: Cannot call method 'addEventListener' of undefined

       at instanceProto.onCreate(c2runtime.js:20559:68)

       at Runtime.load(c2runtime.js:7814:14)

       at window.createCocoonJSRuntime(c2runtime.js:10172:12)

       at c2runtime.js:46513:1

       at c2runtime.js:46515:3

  • Hey guys, love your work. I believe Clay.IO breaks the latest version of CocoonJS. I get the following error when adding the plugin to any project:

    JavaScript Exception: (File:'c2runtime.js' Tag:'script') TypeError: Cannot call method 'addEventListener' of undefined

       at instanceProto.onCreate(c2runtime.js:20559:68)

       at Runtime.load(c2runtime.js:7814:14)

       at window.createCocoonJSRuntime(c2runtime.js:10172:12)

       at c2runtime.js:46513:1

       at c2runtime.js:46515:3

    I have the same problem, I use the Construct2 139 release and the latest version of CocoonJS and Clay.io

    imgur.com/1XtgKGl

  • I already told the problem to Ludei and Austin. Now Ludei figured out what is wrong and Austin is fixing it.

  • Wow thanks for told the problem to Ludei and Austin i dont try it :D

  • Just to update everyone - like Shaircast said, I am aware of it and am working on a fix

  • I've updated the plugin with what should fix the issue. You will need to make a change to a file in the Construct 2 CocoonJS export however.

    In index.html, you will see:

    <html>
         <body>
              <script src="c2runtime.js">
              </script>
         </body>
    </html>
    

    Change that to:

    <html>
         <body>
              <script src="CocoonJS.js"></script>
              <script src="CocoonJS_App.js"></script>
              <script src="CocoonJS_App_ForCocoonJS.js"></script>
              <script src="CocoonJS_App_ForWebView.js"></script>
              <script src="c2runtime.js">
              </script>
         </body>
    </html>
    

    I've reached out to Ashley about getting that setup by default in C2 because I imagine that's breaking one or two of their plugins as well

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Austin. While that does stop CocoonJS from complaining, it also makes the scaling not work and the plugin cannot connect.

    The little white sprite in the top left of the screenshot is all that appears when a leaderboard tries to display:

    lrtw.net/documents/misc/2013-07-22%2015.24.16.png

    That little box is scrollable, its just the logo and:

    "Loading Leaderboard... Debug Mode"

    The leaderboard fails to load, and high scores are not submitted. The condition "Clay.IO is ready" is not true.

    CocooonJS spits out the following error:

    Clay.IO has not connected to its backend yet. Use Clay.Ready() before this call, or email us if you think the issue is on our end

    Keep in mind this all works absolutely fine for the desktop version.

  • If you don't mind, can you email me the zip file you're using to preview the game? austindsg@clay.io

  • For everyone else reading this, the issue cow_trix has most recently was just due to not copying over the new webview files.

  • Hey Austin, how would I go about checking if to see if an in-app purchase was successful after someone clicked a button and successfully credited their credit card?

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