QuickKong - Easy Kong API Integration page 2

52 posts

Flag Post

http://www.kongregate.com/games/scrauler/test-cl
New version uploaded!
Everything is ok now!
Thanks a lot.

 
Flag Post

This class has been added to http://wonderfl.net/c/9rjf

 
Flag Post
Originally posted by BobTheCoolGuy:
Originally posted by Isaacsonlinetwin:

what if you use stencylworks

Stencylworks already has Kongregate tools built into it, so no need for QuickKong

What tools? Please help. I wonna add KongAPIs. Such as leaderboards and/or highscores.

 
Flag Post

I have added the quickkong to my game. locally it works fine. it traces:

[QuickKong] connectToKong()
Alert: Kongregate API shadow services loaded due to local testing. API will load when the game is uploaded.
[QuickKong] loadedAPI()
Kongregate API: IKongregateServices.connect()
[QuickKong] Kong API Successfully loaded and extracted. Shadow Services alert should appear for local testing

It appears also to sent the stats right and I show also the username (QuickKong.userName). Of course locally it only appears as “Guest”. But when I upload it to kongregate nothing works. the stats don’t show up and it even can’t show the username. So I guess it doesn’t connect. Did somebody experienced something similar lately?

 
Flag Post

Nope, I use it* for GDR and its been working.

Are you sure you are letting the API load before accessing the userinfo?

* Actually use a package with some more functionality I added

 
Flag Post

Yea I tried different positions where to load the API but always before I get the userinfo. I tried in the main.as before loading anything else. I tried on first frame in the timeline, I tried in the preloader. And everything works perfectly fine locally but once I upload it to kongregate nothing works. Do I maybe need to publish it first? I only tested it in preview mode. Or is there a debug mode I can try on kongregate ?

 
Flag Post

I’ve tested quick kong and I it works just fine. I’m just a bit confused as to what this class does that the normal kongregate api doesn’t do? (Other then the fact that it’s implemented into a class)
I’m new to actionscript. Sorry if I didn’t understand.

 
Flag Post

Just a wrapper actually. You don’t have to go and read through the documentation to just load the API. You can just copy/pasta this into a class then run with 2 lines of code.

(Also, it keeps an easy-to-reference static instance for convenience.)

 
Flag Post

So it’s just basically packaged better is what your saying or?

I’m curious about a few things with the api.
What happens if my game isn’t on kongregate, will it throw any errors or does the api automatically account for that?
Is there anything we have to account for at all that might give us trouble with the api in general?
Also, what other methods of communication with the api do we have? I read only the one that you had listed, and also referenced the normal api awhile ago, it only excepts a positive integer, or?.

 
Flag Post

Yep, better packaged.

If your game isn’t on Kongregate it should load the Shadow API which is the same as what would happen locally. A developer should account for any issues that would happen. I’ve handled a few of the base cases (such as user-id will throw an error, so I’ve put in a default one) but everything else is up to the developer. Fortunately, only the complicated portions of the API (probably kreds, messaging, etc) might cause issues, so I don’t think many people will run into them.

Communications with the API are through the static vars QuickKong.whatever or if the API is ever expanded you can always access the raw api instance through QuickKong.api.

 
Flag Post

UnknownGuardian, I was about to give up on API for my first game when I found Quickkong! Thanks so much!!

I loaded my game and it showed a highscore tab but it was blank. I hope that’s okay? Sorry I’m a complete dummy on this. Here it is: Justice Bao and the Royal Unfaithful

 
Flag Post

I’m pretty sure its a Kong bug. A few other people are reporting it too. If the API worked for you locally with trace outputs and you’ve set up the correct variables when uploading you should be good to go!

EDIT Yep: Yer game’s highscores are working:

http://www.kongregate.com/high_scores.chat?game_id=158204

 
Flag Post

Thanks! One more question: You added “Access the rest of the API with QuickKong.propertyName”. I don’t know what it is so I didn’t include it. I’m guessing it’s for more advanced features so okay to exclude?

Sorry if I sound ignorant because I am. :p

 
Flag Post

Well, its just example code. You replace “propertyName” with whatever feature of the API you want to access.

For example:

QuickKong.services //access the basic API
QuickKong.chat //access the chat API
QuickKOng.sharedContent //access the shared content API.

So just saying that all parts of the API are available through some QuickKong.x or QuickKong.api.x.

 
Flag Post

Thanks! It was really helpful.

 
Flag Post

This might be a silly question, but I can access QuickKong through every class from anywhere with just using “QuickKong.whatever” and I don’t have to create a reference in order to access it, right?

 
Flag Post

Yep, you can do exactly as you said. QuickKong.whatever from any class after you’ve called QuickKong.connectToKong(stage);

 
Flag Post

Yo, I also implemented with my game:
http://www.kongregate.com/games/HatchetGames/pixelpaddleball

It worked great. PROPS!

 
This post has been removed by an administrator or moderator
 
Flag Post

UnknownGuardian, you’re the man. It worked like charm: in just a minute our game started to submit high scores. So thank you for your top work, and we are proud to say that Battle for Asciion features and uses QuickKong! http://www.kongregate.com/games/RelevoVideogames/battle-for-asciion

 
Flag Post

I followed the first three steps. Locally it seems to output correctly but once I upload it on the website, it doesn’t do anything. Do I also have to upload the *.as file? As additional file?

 
This post has been removed by an administrator or moderator
 
Flag Post

I’ve noticed a few people ask about easy API integration in Unity, so on behalf of them, could you perhaps write a QuickKong class for C# that people could basically attach to their gamelogic or whatever object they want? Not sure how difficult translating between AS3 and C# is.

 
Flag Post

UnknownGuardian, this QuickKong really helped me for my new game SudoKuzzle.

I had to add a check (QuickKong.stats != null) before starting to submit stats to avoid crashes. I don’t know if I did something wrong or if this is expected.

 
Flag Post

bestsiena, that helped me. I need to learn this api for my game.