This user has been permanently banned.
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?