Retrieve Leaderboards Position By Score Or Playerid

[lua]

function print_r ( t )
    local print_r_cache={}
    local function sub_print_r(t,indent)
        if (print_r_cache[tostring(t)]) then
            print(indent…"*"…tostring(t))
        else
            print_r_cache[tostring(t)]=true
            if (type(t)==“table”) then
                for pos,val in pairs(t) do
                    if (type(val)==“table”) then
                        print(indent…"["…pos…"] => “…tostring(t)…” {")
                        sub_print_r(val,indent…string.rep(" “,string.len(pos)+8))
                        print(indent…string.rep(” “,string.len(pos)+6)…”}")
                    elseif (type(val)==“string”) then
                        print(indent…"["…pos…’] => “’…val…’”’)
                    else
                        print(indent…"["…pos…"] => “…tostring(val))
                    end
                end
            else
                print(indent…tostring(t))
            end
        end
    end
    if (type(t)==“table”) then
        print(tostring(t)…” {")
        sub_print_r(t,"  “)
        print(”}")
    else
        sub_print_r(t,"  ")
    end
    print()
end

[/lua]

put that function near the top of your program and then inside the event handler do:

print_r(event)

and see what all it’s returning.  It may not be response, but result or some other variable. 

event.results._id is the right way…

You guys should really work in your docs, hehe

I wasn’t using docs, but looking at the source code:

Runtime:dispatchEvent({name=“MyProfile”, results=response})

Ergo my confusion.  We are using “response” in the function but returning “results” as the array member name.

Ok Rob, I got it to work, but I’m still trying to figure out a way to get the players current position in the leaderboards.

I had figured one way out, but I’ve just read that requesting for the scores in a leaderboard will only retrieve the top 25, which makes my method useless.

I REALLY need a way to do this as we are already past our launch day for one of our games and I’m not being able to find docs about this anywhere.

Hi @guilovsh,

Can you show me where you read this “only top 25” information? This should not be the case… and if it is, we’ll need to fix that a.s.a.p.

Thanks,

Brent

Hey Brent, I’ve read it here and I’m sure in one more topic besides this one:

http://forums.coronalabs.com/topic/34097-how-many-scores-can-the-leaderboards-list/

So… is there any way to do that?

If there isn’t. Is it a feature you plan to include?

Many people are asking for enhanced leaderboard functionality.  At this point I don’t know what is or is not on the leaderboard.  The best thing to do is to go to:

http://feedback.coronalabs.com

And see what features have been requested and vote them up or if your specific need isn’t listed, then add it and get everyone to vote it up.

Alright, I’ll take a look and see if there is any feedback related to this…

Edited:

Nope, didn’t find anything directly related, so I created this feedback:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3909078-enhanced-leaderboard-functions

Ok Rob, I got it to work, but I’m still trying to figure out a way to get the players current position in the leaderboards.

I had figured one way out, but I’ve just read that requesting for the scores in a leaderboard will only retrieve the top 25, which makes my method useless.

I REALLY need a way to do this as we are already past our launch day for one of our games and I’m not being able to find docs about this anywhere.

Hi @guilovsh,

Can you show me where you read this “only top 25” information? This should not be the case… and if it is, we’ll need to fix that a.s.a.p.

Thanks,

Brent

Hey Brent, I’ve read it here and I’m sure in one more topic besides this one:

http://forums.coronalabs.com/topic/34097-how-many-scores-can-the-leaderboards-list/

So… is there any way to do that?

If there isn’t. Is it a feature you plan to include?

Many people are asking for enhanced leaderboard functionality.  At this point I don’t know what is or is not on the leaderboard.  The best thing to do is to go to:

http://feedback.coronalabs.com

And see what features have been requested and vote them up or if your specific need isn’t listed, then add it and get everyone to vote it up.

Alright, I’ll take a look and see if there is any feedback related to this…

Edited:

Nope, didn’t find anything directly related, so I created this feedback:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3909078-enhanced-leaderboard-functions

Any news regarding this topic? 

Any news regarding this topic?