Applying gameNetwork.request

I'm having the hardest time with applying the new gameNetwork.request("setHighScore"... to the below code... I got it off Peach Pellen's paid templates, so for that reason I know if I can post the whole thing, but those familiar should know what I'm talking about. I appreciate any help with this, I just can't figure this out :(

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local onDeviceGO=true
if string.sub(system.pathForFile("Icon.png", system.ResourceDirectory),1,6)=='/Users' then
        onDeviceGO=false
end
 
myscore = score.getScore()
lbID = "XXXXXX"
numScore = score.getScore()
 
function setHighScore( lbID, points )
        if onDeviceGO then
         openfeint.setHighScore(XXXXXX, numScore)
         else
        print("highscore called")
        end 
end
timerGO = timer.performWithDelay(1000, setHighScore, 1)

I assume you've got "XXXXXX" replaced with your actual leaderboard string?

You've also got a: gameNetwork = require "gameNetwork"

And yes, beyond that, it is as simple as replacing the line :)

You also have a typo on the "setHighScore" parameter....

Chunkout Games - yup, I just populated the sample code with Xs here as an example. I added the;

 gameNetwork = require "gameNetwork"

nick_sherman - yea I noticed that right now, but luckily it was only here as I typed it up instead of copy/paste from my file.

All in all it works nicely, and the test user submits score. Thank you both for your contributions!

I noticed that in some tutorials the Test User is needed during the setup part of OF... can I remove the test user once I am up and running or is leaving the test user crucial for the score submit from other players to work?

Test user is NOT crucial for the score submit from other players to work, no.

However you may want to leave it in as it will work with all your other games, if memory serves. (Handy while testing.)

Peach :)

views:1516 update:2011/10/22 9:46:13
corona forums © 2003-2011