Help Adding Openfeint HighScore Board

I have been in the past trying to add Openfeint but had two fail attempts to add them… But this time I would get it. Ok my problem is I got this sample from peach and had fail attempts to get it right. This is the small code sample she has

I will be asking questions in the code so please answer them

[code]local onDeviceGO=true
if string.sub(system.pathForFile(“Icon.png”, system.ResourceDirectory),1,6)==’/Users’ then
onDeviceGO=false
end

myscore = score.getScore()
lbID = “YOUR OPENFEINT LEADERBOARD ID HERE” ---- Is here WERE i PUT The Leaderboard ID?
numScore = score.getScore()

function setHighScore( lbID, points )
if onDeviceGO then
openfeint.setHighScore( 123456, numScore) – For the 123456 what do I replace I got very lost here what do I replace there?
else
print(“highscore called”)
end
end
timerGO = timer.performWithDelay(1000, setHighScore, 1)
– Set the highscore on OpenFeint. I use a one second timer, if you prefer not to, remove the
– timer above and uncomment the line below;
– setHighScore()

[/code]

That’s it everytime I add openfeint nothing shows up in the leaderboard id. After man sweats, and swears, I still fail to add it. Which I need you guys help to get it because this enlight me like this

:smiley: [import]uid: 17058 topic_id: 23864 reply_id: 323864[/import]

Oh wow is this OLD. It’s from, uhm - November 2010? Lol.

I also can’t see you initiating Openfeint?

Anyway, to start Openfeint;
http://developer.anscamobile.com/reference/index/game-network/gamenetworkinit

To post highscore;
http://developer.anscamobile.com/reference/index/game-network/gamenetworkrequest

Peach :wink: [import]uid: 52491 topic_id: 23864 reply_id: 96239[/import]

@peach Hi thanks for the Links, on the to OpenFeint, but When I saw the link and clicked it I saw gamecenter and decided to that instead. When I got there I encounter gamecenter, I would like your help pleeeease in gamecenter. I looked at the example and try to take parts of it so this is how I did it to submit score

[code]

local dis = 0

local function onSystemEvent ()
dis = value
if dis > tonumber(highscore)then --We use tonumber as highscore is a string when loaded
saveFile(“highscore.txt”, dis)
end
end
Runtime:addEventListener( “enterFrame”, onSystemEvent )

local function offlineAlert()
native.showAlert( “GameCenter Offline”, “Please check your internet connection.”, { “OK” } )
end

local function onSubmitScore( event )
if loggedIntoGC then gameNetwork.request( “setHighScore”, { localPlayerScore={ category=leaderBoards[currentBoard], value=userScore }, listener=requestCallback } ); else offlineAlert(); end
end[/code]

Evertime I sumbit my score the score is never submitted. When I go to gamecenter leaderboard nothing shows up on the game. When I click on Players tab on gamecenter it says “No Players” even though I logged into sandbox gamecenter still nothing which get me mad. Also says “No Scores”, and “No Leaderboard” under the leadernoard in gamecenter. What could be the problem. [import]uid: 17058 topic_id: 23864 reply_id: 96468[/import]

@peach sorry for going off topic but I found to be cool to add gamecenter. [import]uid: 17058 topic_id: 23864 reply_id: 96471[/import]

Blasterv (one of our Corona ambassadors) did a great tutorial on this, actually: http://developer.anscamobile.com/forum/2012/01/13/native-game-center-tutorial

Peach :slight_smile: [import]uid: 52491 topic_id: 23864 reply_id: 96502[/import]

@peach oh thanks I saw it just what I needed. But I have one question for this code

function updateHighScore(board, score)  
        if gamenetworkEnabled == true then  
                gameNetwork.request("setHighScore", { localPlayerScore={ value=tonumber(score), category=board }})  
        end  
end  

What do I do here with this when

[code]
So how do I put score dis into that below. Do I just replace score with dis,
or do I do tonumber(score)=dis somewhere

Local dis = 0

{ value=tonumber(score)
[/code] [import]uid: 17058 topic_id: 23864 reply_id: 96517[/import]

I have absolutely no idea what “dis” is in this sense.

Is dis the value for the leaderboard? If so, yes, put it there rather than score.

Also, you don’t need to post normal text in < code > or < lua > tags, just code itself.

Peach :wink: [import]uid: 52491 topic_id: 23864 reply_id: 96523[/import]

@peach sorry for confusion this is what I mean when I have dis

   
local dis = 0 -- This is dis   
  
function updateHighScore(board, score)  
 if gamenetworkEnabled == true then  
 gameNetwork.request("setHighScore", { localPlayerScore={ value=tonumber(score), category=board }})   
 end  
end  
  

So how do I put dis in the value? how do I make it so that when the game is over my score is posted? Do I have to do dis = value somewhere?

[import]uid: 17058 topic_id: 23864 reply_id: 96536[/import]

I still have NO IDEA what “dis” is. Is it the value you want submitted to the leaderboard? I can see it exists and you have made it 0 but I can’t tell from that what the purpose is.

If it is a score or a value you want to submit then replace the word score with the word dis on line 6 of your above code snippet. [import]uid: 52491 topic_id: 23864 reply_id: 96802[/import]

Dis is a slang word for ‘‘curse’’ in the uk. [import]uid: 118379 topic_id: 23864 reply_id: 96818[/import]

Hope that answers your question :slight_smile: [import]uid: 118379 topic_id: 23864 reply_id: 96819[/import]

Really? Lol. Here (and I think in the US?) “dis” or “diss” would mean to disrespect someone - and of course it is also an abbreviation for “distance” in some games.

But from the above it’s not clear what the intent is, maybe the player curses people?

We’ll see :wink: [import]uid: 52491 topic_id: 23864 reply_id: 96831[/import]

@Beloudest, well look I guess I learn something.

@peach Oh great news I finally got it gamecenter is up running and posting scores by the help of Peter. :slight_smile: Thanks for your time trying to help I appreciate it [import]uid: 17058 topic_id: 23864 reply_id: 96980[/import]

Unfortunately what I can do is limited when provided with a nondescript variable and no confirmation on whether or not that is the value you’re trying to submit :wink:

Glad you figured it out. [import]uid: 52491 topic_id: 23864 reply_id: 97037[/import]