{SOLVED} API Confusion??

thor6577

  • Posts: 189
ok i dont get what this part of the API part of stencylpedia. Mostly part in red.

« Last Edit: August 16, 2011, 07:03:31 am by thor6577 »

Greg

  • *
  • Posts: 1260
The first field is the name of the statistic that you set up on Kongregrate (i.e. "Score").  The 2nd field is what you want to set it to (i.e. 100).

thor6577

  • Posts: 189
What about the part in red?

Sunflower

  • Posts: 591
I'm not sure about this red part, but maybe when you upload a game to Kongregate, you actually declare a highscore tables which will be used; you would also give them names, and these names are what should be written in the first blank!

Hectate

  • *
  • Posts: 4643
Kongregate needs certain information on their side. It's recommending that, if you're going to implement Kongregate support, that you read and understand their needs.

http://www.kongregate.com/developer_center/docs/statistics-api
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

thor6577

  • Posts: 189
I mean the part before it says for more info...( all the names must match on kong settings.)
                                                                                       ^ dont really UNDERstand that

Hectate

  • *
  • Posts: 4643
I believe it's referring to usernames. I think there's a block to get a Kongregate's player's username. Later, that name has to match when doing other things with it.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

coleislazy

  • *
  • Posts: 2607
It means the name of the statistic you submit must be the same as the name of the statistic you set up on the game's Kongregate page. The document Hecate linked tells you how to set them up on the Kong side.

Epic428

  • Posts: 1118
All of this is answered for you if you actually read the page on Kongregates website.

To satisfy your question, however, when publishing a game on Kong's website, you are provided with the option to integrate their high scores. When implementing their high scores, you give each "score" a name. For example, you could have a score called "Number of Moves".

Whatever NAME you give the score when setting up a game on Kong's website, you must use that exact same name for stat submission. This allows the Kong API to know what value is changed so that it may be reflected appropriately.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

thor6577

  • Posts: 189
Ooh ty i get it now thanks guys and btw while we are talking bout Kongregate API i have 2 questions.. Do i have to make a behavior that tells the kongregate website that i finished the game and then you get a achievment if someone puts and achievement on my game or if someone gets a certain score to get a badge if the kongregate badge maker puts a badge on it? 2nd question.... Is this behavior right it sends a highscore to kongregate website right?  :-\

Sunflower

  • Posts: 591
If the name of the score table is HighScore, then yes, it should work. Although I have doubts about "setup Kongregate API" block. I mean, one call for a *whole* game is enough and you need to do it at the very beginning. It's just that I don't know what will happen if you setup API multiple times, and will be trying to add a score just after that!
So yes, it's a good habit to setup Kong API at the very beginning, best in the scene with creator/team name (like "Thor6577 Productions presents"), for which you won't go again anymore.

About achievements: I'm not sure about that, but I think that it shouldn't be a big problem once all these statistics are set up. They would require you to add some additional code somewhere, though.

coleislazy

  • *
  • Posts: 2607
Badges exist only on Kongregate side. Your game has no idea what a Kong badge is, and does not need to. The badges they could set for your game are solely based on the statistics you report to them. For example, if you only report the number of enemies killed in a game, Kong could award a badge (or badges) based on that, but they could not award a badge for completing the game in a certain amount of time.

So, the bottom line is: report the statistics you think would make for interesting badges, but its up to Kong to actually implement any of them.

Hectate

  • *
  • Posts: 4643
Technically, they could award a badge based on completion time - if you reported that the player did so. One way is a simple "Yes/No" stat, but another might be "Number of minutes to completion" with a min-type statistic that'd need to be below a set amount to award the badge - the opposite of your "number of kills" example.

But that's still up to Kong to use your stats or not for badges.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

thor6577

  • Posts: 189
Ok ty guys and sunflower i guess ill try putting the setup API block in the begginning of the game.  :)

« Last Edit: August 16, 2011, 07:02:42 am by thor6577 »