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 :frowning:

[lua]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)[/lua]

What I did was; replaced line no.12 with the below
[lua]gameNetwork.request(“setHightScore”, {leaderboardID = “XXXXXX”, score = numScore})[/lua]

I’m sure this is not as simple as replacing the openfeint line with the one above,

Any help with this would be greatly appreciated. [import]uid: 10379 topic_id: 16596 reply_id: 316596[/import]

I assume you’ve got “XXXXXX” replaced with your actual leaderboard string?

You’ve also got a: [lua]gameNetwork = require “gameNetwork”[/lua]

And yes, beyond that, it is as simple as replacing the line :slight_smile: [import]uid: 12448 topic_id: 16596 reply_id: 62047[/import]

You also have a typo on the “setHighScore” parameter… [import]uid: 93133 topic_id: 16596 reply_id: 62051[/import]

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

[lua] gameNetwork = require “gameNetwork”[/lua]

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? [import]uid: 10379 topic_id: 16596 reply_id: 62112[/import]

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 :slight_smile: [import]uid: 52491 topic_id: 16596 reply_id: 62530[/import]