Games Achievements My Kong Sign In
avatar for Info

Info

Points needed for next level: 15 Level

  • Friend
  • Private Message
  • Tools
  • Location

    in your chat box
  • Member Since

    Dec. 11, 2007
  • Website

    http://www.kongregate.com/forums/4/topics/3498

Highscore and Stats API cheatsheet
_root.kongregateServices.connect();
put in your initialisation for both highscores and stats

Statistics
_root.kongregateStats.submit(“stat-name”,int);
submit stats as often as you like, for example at the end of each level.
use Max or Min types for badges,
Add – cumulative, novelty use only, as player could repeat an easy stage many times.
Replace – currently only functions once per page-refresh, so is effectively useless.
Both Add and Replace stats also have problems with daily/weekly/alltime tables.

Highscores – simple
_root.kongregateScores.submit(int);
Submits int as a score – again, can do multiple times during a game.

Multiple highscores – for games with different modes
_root.kongregateScores.setMode(“Mode”);
put this when the mode type is changed, and put a default (probably ‘Normal’) when you initialise, after connecting to the server.
_root.kongregateScores.submit(int);
Will submit a score of int in the current mode

You don’t need to create highscore modes as stats – they are created when one is first declared, and you can then edit it to add a description.

Gotchas
Don’t have either-or stats – Greg can’t use them in badges. That is, if you have eg. alternate endings, also include a stat which is set for all endings.
Stat and highscore values you submit are only reported in the chat box if they update the previous value on the server. For example, for a max-type score with a previous highscore of 100, any update with a score of less than 100 would not be displayed.

To debug a game, add ?debug_level=3 to the URL.

User Name
You can find out a registered user’s name by reading the variable:
level0.kongregateusername

Ideas or suggestions? Leave a shout in the profile. (Please note that this is user-created content – don’t try to communicate with Kongregate here.)

Activity Feed

    Info has not published any activity yet.Would you like to post a shout to welcome them to Kongregate?

See all shouts »

Awards

Friends

Badges

My Games

Developers Players Support YouTube TikTok X (Twitter) LinkedIn
Join the conversation Join Discord
Terms Privacy Code of Conduct
© 2024 Kongregate