00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Using NewgroundIO for scoreboards in Unity

310 Views | 2 Replies
New Topic Respond to this Topic

I have a class which is supposed to call the NGIO.Init() method in a preload scene before the game scene, and a Score class which loads high score data in the game scene. I am getting an error however, telling me that I cant use GetSaveSlot() without setting preloadSaveSlots option to true, however I do have it set to true, in fact I have all the options set to true like how it shows in the github docs

// Set up the options for NGIO.
var options = new Dictionary<string,object>() 
{
    { "version",            "1.0.0" },
    { "checkHostLicense",   true },
    { "autoLogNewView",     true },
    { "preloadMedals",      true },
    { "preloadScoreBoards", true },
    { "preloadSaveSlots",   true }
};

Could this be because I have to add Unity as an app with axis?

iu_1086935_11545318.png

Do I need to have a valid user session to use these methods? If so, how do I "Pull a session ID from the Newgrounds API" as it says in the github docs?


At 9/26/23 12:39 AM, DevGio wrote: I have a class which is supposed to call the NGIO.Init() method in a preload scene before the game scene, and a Score class which loads high score data in the game scene. I am getting an error however, telling me that I cant use GetSaveSlot() without setting preloadSaveSlots option to true, however I do have it set to true, in fact I have all the options set to true like how it shows in the github docs
Could this be because I have to add Unity as an app with axis?

Do I need to have a valid user session to use these methods? If so, how do I "Pull a session ID from the Newgrounds API" as it says in the github docs?


I believe you need to call NGIO.openLoginPage() to open the passport login page before you can use any of the methods


(At least I was having that same message in construct)


You could try joining the newgrounds.io discord as mentioned in the wiki, and search the chat


BBS Signature

Response to Using NewgroundIO for scoreboards in Unity 2023-09-26 19:19:48


At 9/26/23 07:14 PM, orbitz wrote:
At 9/26/23 12:39 AM, DevGio wrote: I have a class which is supposed to call the NGIO.Init() method in a preload scene before the game scene, and a Score class which loads high score data in the game scene. I am getting an error however, telling me that I cant use GetSaveSlot() without setting preloadSaveSlots option to true, however I do have it set to true, in fact I have all the options set to true like how it shows in the github docs
Could this be because I have to add Unity as an app with axis?

Do I need to have a valid user session to use these methods? If so, how do I "Pull a session ID from the Newgrounds API" as it says in the github docs?
I believe you need to call NGIO.openLoginPage() to open the passport login page before you can use any of the methods

(At least I was having that same message in construct)

You could try joining the newgrounds.io discord as mentioned in the wiki, and search the chat


Yeah, I downloaded the example project, and I tried using NGIO.OpenLoginPage() before, and it didnt work, but I think thats because I didn't include NGIO.KeepSessionAlive() in the Update method, because adding this in allowed me to actually use the OpenLoginPage method