This user has been permanently banned.

avatar for Info

Info

Points needed for next level: 15
Level 2
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?

๐Ÿ‘ฅ No friends yet!
Find people you know and start building your gaming network.
Loading...