Thanks Jabor. Can you point me in the direction of the info about the statistics API please.
[Kongregate API] High Scores page 4 (locked)
|
|
|
|
|
|
|
|
I have a game where the score is a distance from a target, that has to be as low as possible. Is there a way to setup the kongregate highscore so the lowest score is the best? Otherwise I have to make the highscore, by subtracting the distance from a high number, wich would work fine, but just would make as much sense. |
|
|
Well now that I posted the question, I see the answers to just that question just above, so never mind. :) |
|
|
Hey, Is It possible to CLEAR the highscore? (or, If Im the owner of the game, delete single entries?) |
|
|
I believe only admins can delete individual scores. You can clear all of them though by deleting the stat and recreating it. |
|
|
Got It! Thanks man! Though I gave up on clearing It – I thought there was a glicth In my code because 1 min after I uploaded the game there was more than 20 people on the high-score. Turns out they all did play the game :) |
|
|
Hi 1) By following ur steps in submitting score, is it possible to know whether the user is signIn or not……? If not, i can pop error message saying ‘PLEASE SIGN-IN TO SUBMIT’ 2) Also after connecting ‘_root.kongregateServices.connect()’, can i get ‘USER NAME’ who is currently playing my game. Thanks :) |
|
|
You can read the variable level0.kongregateusername – If you’re not logged in it is “Guest” (I checked on a game of mine which pre-fills the name for an external high-score table). And if the game isn’t on Kongregate it’ll be undefined. …Of course, someone might be able to register the name “Guest” I suppose. But then they’d get what they deserved. |
|
|
I just keep getting this error message: Error Symbol=sprite 93, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler does anyone knows what does it mean? |
|
|
@icedavis: It seems like you’re tyring to put the code onto a MovieClip symbol, when you should be putting it on a frame or in a class. You can put it on a MovieClip if you absolutely need to, but it needs to be inside an “on handler” onClipEvent(*){}) to be used that way. |
|
|
now, in the example, we would replace the 1000 with a variable, right? like this: _root.kongregateScores.submit(score); score being the score they got? |
|
|
Generally, yes. |
|
|
In the following code I attempted to store an array of the user scores from Kongregate into an array ‘userscores,’ but it doesn’t appear to be working properly. How do I change my code such that ‘userscores’ will contain the correct information? |
|
|
Why are you using userscores = this? |
|
|
Because I don’t know how to access the score data, what should I use? |
|
|
Remove userscores = this. Then customize the scoresCallback function to use the data how you like. You access it through the result parameter its sending back, like you are trying to do; but you need a purpose. What are you trying to do with the data? For instance, if you want to put in a text field, you could just do something like my_text.text += result.list[i].username = “\n”; Really, it all depends on how you plan to use the information. |
|
|
What version of AS is this script for? |
|
|
I entered the following code and I’m having issues. When people play the all get a score of 50. I did have the setting at 20 and changed it to 50 since that was the max top score possible I entered the code like this
var scoresCallback:Function = function( result:Object ){
trace("High score result, success=" + result.success );
for( var i:Number = 0; i < result.list.length; i++ ){
var position:Number = i + 1;
trace( position + ". " + result.list[i].username + " - " + result.list[i].score );
}
}
_root.kongregateScores.requestList( scoresCallback, this );
_root.kongregateServices.connect();
_root.kongregateScores.setMode("Normal");
_root.kongregateScores.submit(50); // Will submit a score of 50 for normal mode
|
|
|
The_Dodo: AS2 minusdriver: I’m not sure what you are stating is exactly the issue. |
|
|
Hi ArcaneCoder thanks for quick reply. Basically I entered that code and its in my game. It seems to be working… well kind of because it is recording the score. But some people aren’t even playing the game and records them with a high score of 50. I know my game isn’t all that great but its my first one and I’m basically learning and trying to make it much better. http://www.kongregate.com/games/minusdriver/exploding-bugs Maybe with a link you can understand what I mean. |
|
|
Define “playing the game”. Do you mean they haven’t clicked ‘start’ yet? If you use the submit command to send a value of 50, its going to record them on the score board with that score as soon as you send it. |
|
|
yea, change the 50 to the score variable. |
|
|
Does API work with AS1? |
|
|
My scores API is working just fine and the scores are being submitted, the problem is that you can’t submit a score more than once unless you reload the game again. How can I correct this bug. The Code…………………………………………. btSubmit.onRelease = function() {
_root.kongregateServices.connect();
_root.kongregateScores.submit(_parent.nScore);
};
var scoresCallback:Function = function (result:Object) {
trace("High score result, success="+result.success);
for (var i:Number = 0; i<result.list.length; i++) {
var position:Number = i+1;
trace(position+". "result.list[i].username" - "+result.list[i].score);
}
};
_root.kongregateScores.requestList(scoresCallback,this);
_parent.gotoAndStop("MainMenu");
|
Loading