API Documentation page 2

58 posts

Flag Post

I’m probably just blind, but does it say somewhere in the guide how to send and get high scores?

 
Flag Post

http://www.kongregate.com/developer_center/docs/statistics-api

Please note that you can only send highscores. Retrieving highscores has been removed from the API.

 
Flag Post
Originally posted by UnknownGuardian:

http://www.kongregate.com/developer_center/docs/statistics-api

Please note that you can only send highscores. Retrieving highscores has been removed from the API.

Ohhh… scores are a statistic now? Thank you. Also, awwww at not being able to retrieve high scores.. Though I guess it makes sense.

 
Flag Post

This might be the wrong place to ask, but does anyone know if you cn get the API to work in Adobe Flex Builder 3 or in Flash Develop?

 
Flag Post

I’m not sure if the connection to Kongregate is working. How do I check that?

The scores for my new game just aren’t submitting at all.

 
Flag Post

test
bc. asdfs;fdsaf

 
Flag Post
function onLoad()
{_root.kongregateServices.connect();}
var clicks;
var kongregate = _global.kongregate;

It won’t connect under my preview all it says is more games, I have this code under the first frame of layer 5 in my game.
Does anyone know what I’m doing wrong?

on(release)
{_root.kongregateStats.submit("Clicks", clicks);}

This is what I am using to submit the highscore.

 
Flag Post

Must salute to you, never saw a more sophisticated ID theft software, and its all legal : coz u have to press yes – caesary is the so called game ? ha? sophisticated spyware, best i ever saw.

 
Flag Post
Originally posted by bhattarai333:
function onLoad()
{_root.kongregateServices.connect();}
var clicks;
var kongregate = _global.kongregate;

It won’t connect under my preview all it says is more games, I have this code under the first frame of layer 5 in my game.
Does anyone know what I’m doing wrong?

on(release)
{_root.kongregateStats.submit("Clicks", clicks);}

This is what I am using to submit the highscore.

when you upload the game, submit the stat as Clicks. That should work… And try _root.clicks

 
Flag Post

I load the api in the beginning, but when i call kongregate.stats.submit(…) at the end, it gives me error 1010. ?

 
Flag Post

Maybe it is better for kongregate to provide a PDF file :)

 
Flag Post
Originally posted by dosmoyi:

Maybe it is better for kongregate to provide a PDF file :)

The online documentation works just fine.

 
Flag Post

Just curiously, does the kongregate api have a complete, normal javadoc style reference?

 
Flag Post
Originally posted by BobTheCoolGuy:

Just curiously, does the kongregate api have a complete, normal javadoc style reference?

Arcanecoder used to have one, but its not up to date.

 
Flag Post
Originally posted by BobTheCoolGuy:

Just curiously, does the kongregate api have a complete, normal javadoc style reference?

from what i’ve seen of kongs code: no. much like my code it’ll be largely undocumented and in order to understand it you must read it. except my publicly released code has information on what the public functions do in a comment above it

 
Flag Post

God bless tutorials.

http://www.kongregate.com/games/Kongregate/kongregate-stats-api-tutorial-actionscript-3

Don’t bother with the documentation untill you go advanced or atleast untill the thing is working.

 
Flag Post

I am probably just missing this somewhere but when i am previewing the game how do i know if the stats are actually being submitted. Because when i try it on my computer in flash it tells me in the output the it is submitted but i don’t know how to tell in the preview section here on kongregate.

 
Flag Post
Originally posted by UnknownGuardian:

Please note that you can only send highscores. Retrieving highscores has been removed from the API.

I remember an old post about how there used to be the functionality to get lots of info about the player and what not through the API, but it all had been removed because no one used it. (Though I can be mistaken)

But I was thinking about making a game that uses some of the player’s info (most importantly his Kongregate user level).
But it seems that only the player’s user name can be obtained. Is there any way to get other player info ?
Info I might be able to use would be: User name, level, points, specific badges, specific games stats, …

Also, when loading custom (user created) levels and the like, is there a way to see who made it ?
(most importantly to check wheter it’s made by the current player or not)

 
Flag Post

Is there any way to get other player info ?

You can get a JSON file with most of the user info you need from http://www.kongregate.com/api/user_info.json?username=Stef1987, changing your username to the user you want the info for. It contains the users level and points, but not specific badges or game stats.

Use the as3corelib to decode the JSON into a usable object.

Also, when loading custom (user created) levels and the like, is there a way to see who made it ?
(most importantly to check wheter it’s made by the current player or not)

Not as far as I can tell.

 
Flag Post
Originally posted by nojkimserious:

Is there any way to get other player info ?

You can get a JSON file with most of the user info you need from http://www.kongregate.com/api/user_info.json?username=Stef1987, changing your username to the user you want the info for. It contains the users level and points, but not specific badges or game stats.

Use the as3corelib to decode the JSON into a usable object.

Also, when loading custom (user created) levels and the like, is there a way to see who made it ?
(most importantly to check wheter it’s made by the current player or not)

Not as far as I can tell.

as3 is getting json stuff built in soon, which should be nice. In regards to telling whose level it is, just write their name in to the level string and have your level parser read it. You can encode any info you want this way really.

 
Flag Post

Thanks for the answer.
So, I could access this json file from within a game on kongregate ?
well I guess that’s possible, but I just have never done anything like that.

Originally posted by nojkimserious:

Also, when loading custom (user created) levels and the like, is there a way to see who made it ?
(most importantly to check wheter it’s made by the current player or not)

Not as far as I can tell.

I just realised a simple solution, I could just add the player’s username into the leveldata that’s stored. That should work.

EDIT:
Thanks BobTheCoolGuy,
I started writing this post before you had posted this, so I hadn’t seen it yet.

I’m using unity more nowadays, so no actionscript for me

 
Flag Post

So, I could access this json file from within a game on kongregate ? well I guess that’s possible, but I just have never done anything like that.

In AS3 it would look something like this:

var request:URLRequest = new URLRequest("http://www.kongregate.com/api/user_info.json?username=" + kongregate.services.getUserName());

var loader:URLLoader = new URLLoader(request);
loader.addEventListener(Event.COMPLETE, onLoadComplete);
loader.load();

private function onLoadComplete(e:Event):void
{
    var userInfo:Object = JSON.decode(loader.data);
    trace(userInfo.user_vars.level);
    //etc
}

I’m sure Unity has something similar.

 
Flag Post

alright, thanks, I’ll try it.

also, seems I can get the badges:
http://www.kongregate.com/forums/4-programming/topics/58167-new-json-feed-of-badge-info

 
Flag Post

this post i wrote recently is relevant to the discussion at hand: http://www.skyript.com/2011/06/json-parsers-stats.html

 
Flag Post

nojkimserious, actually you’d have to pull from api.kongregate.com