API doesn't work online

7 posts

Flag Post

Hey guys, I’m creating a flash game. I’ve implemented the API (correctly, I hope). When I run the game, here’s an example output shown in the box:

Alert: Kongregate API shadow services loaded due to local testing. API will load when the game is uploaded.
Kongregate API: IKongregateServices.connect()
Kongregate API: IHighScoreServices.submit(2520)
Kongregate API: IStatServices.submitStat(Highest Level,4)
Kongregate API: IHighScoreServices.submit(0)
Kongregate API: IStatServices.submitStat(Highest Level,1)
Kongregate API: IHighScoreServices.submit(0)
Kongregate API: IStatServices.submitStat(Highest Level,1)
Kongregate API: IStatServices.submitStat(Attempted to cheat,1)
Kongregate API: IStatServices.submitStat(Attempted to cheat,1)
Kongregate API: IHighScoreServices.submit(4330)
Kongregate API: IStatServices.submitStat(Highest Level,6)

However, when I upload the game on kongregate to test it, only one stat gets submitted – the “Attempted to cheat” stat. Everything else does not appear in the highscores. Furthermore, the “Attempted to cheat” stat only gets updated when I refresh the page.

Also, ?debug_level=3. Does this work? When I use it, I don’t see “info” spamming the chat. However, after refreshing, the “Attempted to cheat” stat does increase.

I’ve declared “Attempted to cheat” as an add stat, and “Highest Level” as a max stat, in the game’s API.

Can someone help?

 
Flag Post

It’s likely a bug in your code. If the API is working offline, then it should be working online, especially if you know at least 1 score is being submitted. (Perhaps you forgot to check “Display on Leaderboards” for the rest of your stats?

 
Flag Post
Originally posted by UnknownGuardian:

(Perhaps you forgot to check “Display on Leaderboards” for the rest of your stats?

Ooops… haha, yes I did.

What about the highscore stat though?

 Kongregate API: IHighScoreServices.submit(4330) 

This isn’t appearing in the highscores. Am I supposed to declare this as well?

 
Flag Post

Um. I didn’t know that they allowed you to pass in a single param. I’d suggest actually naming your stat something, then handling it like the rest.

 
Flag Post
Originally posted by ChooJeremy:
Originally posted by UnknownGuardian:

(Perhaps you forgot to check “Display on Leaderboards” for the rest of your stats?

Ooops… haha, yes I did.

What about the highscore stat though?

 Kongregate API: IHighScoreServices.submit(4330) 

This isn’t appearing in the highscores. Am I supposed to declare this as well?

The Highscore API is depreciated.

 
Flag Post

I see. Thanks guys, it works now. :3

Avoider

 
Flag Post
Originally posted by ChooJeremy:

I see. Thanks guys, it works now. :3

Avoider

Your “attempted to cheat” stat is currently the first high score people see, which means 95% of people will only ever see that. You should do something about that.