Nuggeta Extension: for multiplayer online games, Leaderboard, Chat and Inventory

Kazetoon

  • *
  • Posts: 556
I'd probably make the request twice and use separate attributes for them.
So I tried using the request twice but it seems to request the same scores timespan. In this case it requests the day leaderboard since it is my first request. My code execute only once and looks like this:

I did set different list attributes for each leaderboard request before the cancel block but they are not shown in the picture since I removed a lot of irrelevant things to keep the screenshot simple and seem to have removed them accidently.

Edit: I just tested and the checking leaderboard response in the requestWeek custom event is checking my day request instead of the week request. Could this be the issue?

« Last Edit: July 25, 2014, 12:37:20 am by Kazetoon »
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

SadiQ

  • Posts: 1795
Do you actually have anything in that leaderboard that is a week old? Maybe that could be the case?
Try requesting ALL the leaderboard after the Day, just to make sure your code is working (it should work from what I see).
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Kazetoon

  • *
  • Posts: 556
Shouldn't the week leaderboard include the day? You mean I should put the requests one after the other like:
Request leaderboard day
Set attribute 1 to get leaderboard
Request leaderboard week
Set attribute 2 to get leaderboard
Request leaderboard all
Set attribute 3 to get leaderboard
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

SadiQ

  • Posts: 1795
If I'm not mistaken the week leaderboard has data in it after a week passed since the first entry in that leaderboard, so that may be the reason you're not getting any data when you request it.
And yes, that is how you should request your leaderboards if you want to display them all at once.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Kazetoon

  • *
  • Posts: 556
If I'm not mistaken the week leaderboard has data in it after a week passed since the first entry in that leaderboard, so that may be the reason you're not getting any data when you request it.
And yes, that is how you should request your leaderboards if you want to display them all at once.
Alright I think I fixed it now, what I did is I put a do after 1 second before checking the request responses just to give it enough time to request the leaderboard and then check it correctly. Also, the week leaderboard shows data up until a week old so the data submitted yesterday and today are shown in the week leaderboard.
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

SadiQ

  • Posts: 1795
You can use the Always event to check for responses from Nuggeta (You will only get a responce once so it's safe to use it there), and you can request the week leaderboard after you get the day one and so on(just keep a boolean to know which one you're suposed to receive and request) (again, you can use the Always event since everything inside the nuggeta wrappers will only execute once )
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Kazetoon

  • *
  • Posts: 556
Alright, thanks for the info.
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

Kazetoon

  • *
  • Posts: 556
I think the problem is that if I use something like this:

Request leaderboard day
Check response if success then Set attribute 1 to get leaderboard
Request leaderboard week
Check response if success then Set attribute 2 to get leaderboard


The check response for the week leaderboard is checking the response of the first request which means that when I am setting attribute 2, it gets the leaderboard for the day instead of the week. This is why both of my list are equal. If I do it like this:

Request leaderboard day
Check response if success then Set attribute 1 to get leaderboard
Request leaderboard week
Do after 10 seconds, check response if success then Set attribute 2 to get leaderboard


 it works fine.
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

SadiQ

  • Posts: 1795
And what if you receive that request before those 10 seconds? Players won't have the same lag as you do.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Kazetoon

  • *
  • Posts: 556
And what if you receive that request before those 10 seconds? Players won't have the same lag as you do.
I know, I'm not saying that this is the fix but what can I do to make sure that the checking respond block checks the right request?
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

SadiQ

  • Posts: 1795
Something like this should work:
request leaderboard for day
//create a number attribute or text one

Always event:
if leaderboard response is success
    if number == 0 (or the text attribute is "Day" )
            //you'll get the leaderboard for the day
             do things with the leaderboard for the day
              request leaderboard for the week and increase the number to 1 or change the text to "week"
     if number == 1 (or text attribute is "week")
            //you'll get the leaderboard for the week since you increased the number when you received the first request
            do things with the leaderboard for the  week
            request leaderboard for ALL and increase the number to 2 or change the text to "all"
     if number == 2
     ...you should get the point

Remember to set the text back to day or the number to 0 when you want to request all your leaderboards again.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Kazetoon

  • *
  • Posts: 556
I'll try it out and see how it goes. You are right it will most likely work like that. Mine uses a check response block for each request which is probably what's causing the issue. I need to use only 1 check response block.

Edit: It works :)

« Last Edit: July 25, 2014, 03:37:58 pm by Kazetoon »
Little Drop - Try it out!
     
iphone/ipad Android
Newgrounds Stencyl Arcade Kongregate
Developer Website

FranAlt

  • Posts: 169
Hi, I feel really dumb for saying this but I can't even connect. All I want to do is to implement a leaderboard but Im not even able to connect to Nuggeta. Im not getting any errors, the game compiles and runs perfectly. I followed the guide but Im always getting "Failed" as a response. I attached screenshots, maybe someone can tell me what Im doing wrong. The last one is from the Leaderboard behavior, but again I can't even get started. Im trying in iOS, Android, Flash, and Web Browser but still nothing... :'(
Swipe - FREE          Cloud Run - FREE              
                                  
         iOS                                Android
    Android

SadiQ

  • Posts: 1795
They seem to make games inactive in the nuggeta website if they are unused for 2 weeks, and to fix that we need to re-deploy the game to activate it.
 Maybe that's what has happened in your case?
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

FranAlt

  • Posts: 169
Unfortunately that doesn't seem to be my case. I re-created and deployed the game on Nuggeta today to see if that was the problem, still no luck. What should I do?
Swipe - FREE          Cloud Run - FREE              
                                  
         iOS                                Android
    Android