Simple GameJolt API plugin for Construct 2

GameJolt API plugin for Construct 2

As you may know, there's a program called Construct 2. You can make games with it. While I'm generally not a huge fan of built-in scripting system (scene editor and idea of behaviours are pretty great though), some people make nice games with that.

Also there's Game Jolt. Game Jolt is a site you can host your games, devlogs, and related media upon. It's great. I'm not sure which of Saturn's moons you are living on if you haven't heard of it by now.

Then when two come together... you can upload Construct 2 games to GameJolt, but you cannot use any of it's quite so nice Game APIs (such as high score tables, trophies, data stores...), since, well, noone made a plugin for that so far.

Seeing that, I thought that I may as well fix that part (a bit). So I have devoted a bit of time over few days and have made a plugin that provides basic functionality, such as sending scores and trophies. Everything is pretty straight-forward and easy to get hang of.

Installation is simple also - download ZIP file below, and unzip contents (a folder called "gamejolt") into HTML5 plugins directory (Construct 2\exporters\html5\plugins) in your Construct 2 installation. Upon next launch of program, GameJolt plugin will be available in "Platform specific" category alongside of Kongregate, Scirra arcade, and other items.

That's pretty much it, I guess. Download links are below. If there are any questions, feel free to ask.

GameJolt page (demo+downloads)

Update (August 2014)

Extension has been updated to include additional functions. So have been links in this post and files on GameJolt.

Related posts:

25 thoughts on “Simple GameJolt API plugin for Construct 2

    • Add multiple trophies on GameJolt side and then use each according ID with “Achieve trophy” action.

  1. So, I learned about the doc.
    In the example, they give:


    So … What I want to do is start with open session, so I replace data-store with “sessions / open /”.
    This is where I start having difficulties.
    So, the game id I put it under my variable, then in “& key = test”, I have to replace the test by my game key? If so, then what is the signature in the request? We can not directly put the key on the signature?
    Anyway .. suddenly my request is that, but it does not work, could you tell me where is the error please?

    Resquest = “”&GJ_game_id&”&key=”&GJ_key&”&username=”&tb_Gamejolt_user.Text&”&user_token=”&tb_Gamejolt_token.Text&”&signature=”&GJ_key

    • That’s for sending requests. The extension does this part for you. You should only need to append “?username=YourName&user_token=YourToken” to the end of your localhost URL.

      The extension has a separate “login” action that you can use if nothing else works – will need to put two input fields and a button somewhere for that.

  2. Thank you for your answer.
    On the other hand, my English is rather average of more I am not an expert on construct 2.
    So … “you’ll need to append username and user token to the URL, like”? Gjapi_username = Banatawa & gjapi_token = “” Where can I do that? And will I still need the plugin?

  3. Strange, the plugin don’t work…
    First I thought that it was ’cause I don’t update C2, but.. I download the .capx and he doesn’t work too… “Not logged in. Possibly logging in…”.

    • If testing locally (rather than having uploaded the game to GJ), you’ll need to append username and user token to the URL, like “?gjapi_username=Banatawa&gjapi_token=“. GameJolt documentation has a further explanation of this somewhere.

  4. Hi! just discovered this plugin browsing the scirra forums! Is this working for mobile games? It would be awesome to use as leaderboards.

    • It should work on mobile, but you’ll need to offer the user a way to enter their GJ name + token (unless you want non-signed leaderboards) and use the “Auth” action to connect.

      • Thanks for reply! Sorry I’m new so I don’t know what you meant by non-signed leaderboards. Does that mean you can submit your score just by entering a random name then submit?

        • Indeed. When configuring a leaderboard, you can allow submitting as guest, and then you can use the according action for that.

          • Thanks a lot! I’m gonna try this later hope I could get it to work!

    • On “native” C2 games (which are secretly your game bundled with a browser for it) you’ll need to make some sort of login form and use the login action if you need to use non-anonymous actions.

  5. Hey this plugin is great and amazing and really easy to use
    However there is some problem with it. Whenever i post score, the score is posted multiple times at the same time. The same score appears 20 to 40 times in leaderboard table
    Please fix it

    • It’s rather unlikely that the problem is in the plugin – pretty much all of it’s functions are “convenience wrappers” over the raw HTTP requests to GameJolt API. So it cannot quite submit the score multiple times unless you tell it to submit the score multiple times. I would suggest to add some logging (I recall that Construct 2 had some debugging functionality) to check if and why the action is triggered more than once.

  6. Is it possible for me to add a notification that they got the achievment? If yes can you upload a tutorial?

  7. This plugin is going to be a huge thing! Thanks, I used to make with hashes, it was not complicated, but, it was long, very long for my simple games.

    Thanks again, I’ll mention your plugin in all the games made by me with the others, I know it doesn’t seem to be a big thing, but it is, for me and for everybody who didn’t want to use Hashes.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.