0 Favourites

Kongregate Statistic Issue

  • Hi Guys,

    For those who have uploaded their game to Kongregate, do they have any problems submitting highscores to Kongregate server?

    For some odd reason my game isn't sending any data, both FireFox and Chrome. Previously only FireFox worked.

    I tried both methods; exporting as Kongregate and also followed this tutorial by CanGame (https://www.scirra.com/tutorials/597/kongregate-highscores-achievements).

    Anyone can help? Thanks in advance.

  • Well, had the same problems, and after fighting it for a while, I realized that there's something wrong on the index.html file that C2 generates when you export it for Kongregate. I've looked through the console in Chrome, and it was pointing to an http that retrieved a GET error.

    So open your index.html in an editor an replace this line:

    <script src="//www.kongregate.com/javascripts/kongregate_api.js"></script>

    To this one:

    <script src="https://ssl.kongcdn.com/javascripts/kongregate_api.js"></script>

    That should do the trick (Y)

  • Awesome! Thanks for the reply.

    That issue has been giving me tons of headache

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Hi lukedirago

    Unfortunately it doesn't seem to work. Did you export it as Kongregate and then change the js url?

  • Exactly. Firefox was 50/50 times connecting. Chrome couldn't connect at all. I checked the console, and the js that goes to the kong API was getting errors; so I went to the URL and it redirected me to the ssl url that I posted here. After that, no problem at all. Here's the game in Kongregate

    kongregate.com/games/lukedirago/derez-infinite

  • I will give it a try again, it wasn't working for me for some reason.

    Btw awesome game :) the pixelated effect confused me at first. I keep thinking whether my eyes were going blur or something haha.

    Edit: May I ask 2 things?

    1. how did you get the username to show on your main menu? Can't seem to find anything from the Kongregate plugin to show that.

    2. how did you submit the score? Was it just "Submit statistic when game ends" or you used "On Login" > "submit statistic when game ends"?

    Thanks in advance :)

  • flipboxgames try to put my name like this lukedirago so I get a notification ;) I just entered back here by chance!

    Sure, let me show you how I did it:

    • This is on the very first layout, so I make sure that it 'connects' to Kongregate, so this way you know if it's working with the API regardless of the statistic. Just put a text object (in my case is a SpriteFont, but conceptually is the same) and set text to "Welcome guest" if <I>is guest</I> and "Welcome "&Kongregate.UserName

    <img src="http://i.imgur.com/kqrxaqf.jpg" border="0" />

    And then, when I go to my layout "Death" this happens:

    • Basically I have two stats, one "max" and other one that is "add". At the very last, I submit the two statistics.

    <img src="http://i.imgur.com/kli47X5.jpg" border="0" />

    Hope it helped, let me know if you need anything else ;)

  • lukedirago

    Ah thanks. I didn't know that.

    I tried using your methods but it's still showing Guest instead of Kongregate username. Double check to make sure I changed the url to the one you had provided but no luck :(

    Are you using Construct 2 R139 or the latest beta?

    Edit: After I left my game idle for a short while, it showed that I was disconnected from Kongregate server and trying to reconnect, to which it never did.

  • flipboxgames I'm using r143

    Have you tried to look at the console output in Chrome? You don't get any errors?

  • lukedirago

    seems like the problem is from my hosting.

    http://postimage.org/

    pictures upload

    Are you using your own hosting or dropbox? Or did you figure out how to upload directly to Kongregate since they allow uploads for HTML5 games (fingers cross on the last part :P).

  • flipboxgames

    well, is a start to identify the problem. I'm using my own host. Do you mind sending another screenshot, but with the full error? (click the arrow so we can see more of it)

    I know it's not a perfect solution, and it would require a little of mutual trust, but... maybe I can give you a folder on my server, I have ssl, so you can see if that's the problem, or maybe is something else is. Anyway, if you want to give it a try, send me a pm and I wouldn't have a problem to help you out on that :)

  • lukedirago

    That would be awesome :) Will be sending you a PM soon with the screenshot

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
300 118,427
blackhornet's avatar
blackhornet
Unread sticky
0 Favourites
C2 Games on Kongregate
184 201,570
RGames's avatar
RGames
Unread hot topic
0 Favourites
Spam issue
201 16,837
Tom's avatar
Tom Construct Team Founder