[PLUGIN] Clay.io (leaderboards & achievements)

From the Asset Store
Implement a customizable array-based achievement system with the fully-commented template.
  • Can you send me an email to austin |at| clay.io?

  • With what? I will tomorrow in the offices.

  • Anything, just so I have an email to reply to :) It's a bit easier for me to communicate that way than through PMs here

  • Another update: CocoonJS is still in the works -- I spent the last few days implementing a "Push to Windows 8 App Store" feature (and some pushing to other app stores as well), though that probably isn't very important to the folks here since C2 already has a nice exporter for that.

    What is relevant here is I've updated the plugin to work with Windows 8. Windows 8 has some restrictions where you're not allowed to call external scripts and CSS, so the API and styling for it are stored locally (this is also something necessary for CocoonJS). If you're exporting to Windows 8, change the export mode property for the Clay.io plugin to "Windows 8". It'll do the export and generate a default.html file, in that you'll have to add in:

    <link href="/api.css" rel="external" />

    <script type="text/javascript" src="/socket.io.js"></script>

    <script type="text/javascript" src="/api.js"></script>

    It isn't the prettiest solution (having to manually add that in), but it's the best I can do with the current C2.

    Good news, i'm going to test them.

    I have a question, do you offer ad system?

  • I had some problems when i'm testing CocoonJS with Clay.io inregration, it doesn't run the game.

    There are pics:

    <img src="http://i.imgur.com/KQZh1.png" border="0" />

    <img src="http://i.imgur.com/LWHHi.png" border="0" />

    Export module: CocoonJS

    Debug: Enabled (Also Disabled too)

    Minified: No

  • CocoonJS integration is still a work in progress :)

    And no, no ad system yet.

  • I'm trying to use the web storage and having some difficulty. Could you add some more explanation to the instructions, you say you can store arrays if you pass loopindex, but don't say how.

    I thought I had something that would work, (a loop) but I can't store a simple number and read it right back.

    EDIT: Ok I just found "Data Fetched" event, so I was checking before it was there. But my Array loop definately won't work with that.

    Other questions, is there a trigger for when an Achievement is accepted as new, so I can play a sound as well as Clay's little popup too? And could the popup stay a second more, it's gone before the game lets the player glance up there.

    Thanks for any help you can offer.

    edit: I'm using Construct2 R106, and achivements, the achievement list, and player name values all work fine.

  • CocoonJS integration is still a work in progress :)

    And no, no ad system yet.

    Good, thanks.

    I have a question, does clay.io allow us to use adsense on inside of the games?

  • Clay.io is not working with r106 exporting to exe :(

    Anyone having the same problems?

  • Paradox The standard API when you're using just JavaScript to write your game accepts JavaScript objects and arrays. I was thinking that implementation would translate over to Construct 2, but it turns out the only parameters you can specify to pass to an action are strings and numbers, so you can't actually pass an array.

    What you'll have to do is pass the "AsJSON" expression of the Array object to the Clay.io action. From their I think the looping will work, but it may not as the JSON could be read as a string. If that's the case I'll update the plugin to parse the JSON automatically.

    There is an "Achievement Awarded" trigger.

    Joannesalfa Adsense is fine.

    devMidgard looking into it now

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Joannesalfa Adsense is fine.

    Thanks for letting me know. It could be a good opportunity for game developers to keep making more new games.

  • And when I look again for the Achievement trigger, there it is, top of the list. {slapping forehead} Thank you.

    There are a couple possible achievement bugs. In Construct2 you can't use the "Unique Identifier" as the "Achievement ID" field says it only accepts numbers.

    And the Debug mode doesn't seem to be working, Achievements are still being posted to the stream. (Racr may be having a similar problem too, he just posted like 40 screenshots to the Clay stream)


    and hopefully last on Achievements, Is there a way to sort the list? As I make them up, I would like some form of grouping, except for the completed ones which would appear at the top. (I plan on having 40-50, most hard to get.)

    A future wish would be icons on the Achievement window, for completed only, replacing the checkmarks, as they load.


    And on the Arrays, Storing "Array.AsJSON" and then after retrieving:

    "Array | Load JSON string Clayio.Data"

    seems to work perfectly,


  • I was waiting to respond to this until I found some time to get those things fixed/implemented, but so I don't seem like I'm MIA, I'll respond now :) They'll be implemented soon!

  • an idea to keep a possible complication simple:

    If you are adding a sort for the achievements, it could be just choosing what to sort by, the number (current sort,) the name, or the Unique Identifier, which would be the custom sort as well as the id name.

  • 1) Updated the plugin to allow for unique identifiers (strings)

    2) Debug mode posts will show up in *your* stream, but not anyone elses, just so you can verify the posting to stream works :) I don't think RACR has his game in debug mode, which is why the screenshots show for you.

    3) I made it so you can show the icons when showing all achievements, here's how that shows up: screencloud.net/v/dLAa - I can change up the default look of that if that's not ideal.

    Grouping is a longer task to tackle, so that's not complete yet (nor have I started it)

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