00:00
00:00
Newgrounds Background Image Theme

Burning78Omen34 just joined the crew!

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!

Newgrounds.io Help & Support

43,471 Views | 136 Replies
New Topic Respond to this Topic

Response to Newgrounds.io Help & Support 2020-05-11 20:12:53


I'm not expecting anyone to know what's going on here, but I figured I'd post this error readout I get when trying to run my game in browser, just in case anyone recognizes it. Everything works fine if I gut the NG.io code from my project, but including it in any form and the game won't will crash immediately after loading:

iu_120296_7358011.png

iu_120297_7358011.png

iu_120298_7358011.png

Now, I am using an currently unreleased Unity package by RallyX for NG.io, but setting things up the normal way without it gives me the same problem. There appear to be no problems in editor, and reading the network data for the medal unlock calls shows it working fine. I've tested a bunch of possible fixed and I don't have any leads, other than that it will work in other Unity projects sometimes. This is a real bummer since I was excited to include NG medals and already had the code / icons for them.


Banner by @MigMoog

BBS Signature

Response to Newgrounds.io Help & Support 2020-05-12 12:49:35


Okay, we're all good. Ralix figured out that the problem was with the webGL template I'm using, and was able to update the newgroundsioPlugin.jslib code to account for it.


Banner by @MigMoog

BBS Signature

Response to Newgrounds.io Help & Support 2020-05-24 01:14:54


I'd like to make a game where the player's newgrounds level/experience points affect their in-game power.


How do I go about getting a read-only value for the player's level?


At 5/24/20 01:14 AM, voter96 wrote: I'd like to make a game where the player's newgrounds level/experience points affect their in-game power.

How do I go about getting a read-only value for the player's level?


It's a bit more complicated, because as far as I'm aware, you can't access the information with the newgrounds.io alone. I'm not sure if it's the best approach, but with the username, you can create a link to the userpage, send a GET request and parse the page's source code in any way you want.


Here's the gist of what I'm personally doing in Unity:


        /// <summary>
        ///     Loads all text from an url and after it finishes downloading, calls a method to parse the text.
        /// </summary>
        /// <param name="url">Url to load text from ("https://[username].newgrounds.com/").</param>
        /// <param name="textParserMethod">Method to use to parse the obtained text.</param>
        /// <returns>All source code text.</returns>
        static IEnumerator LoadPage(string url, Action<string> textParserMethod)
        {
            UnityWebRequest userpage;
            try
            {
                userpage = UnityWebRequest.Get(url); // url = "https://voter96.newgrounds.com/"
            }
            catch (UriFormatException)
            {
                url = Regex.Replace("https://{username}.newgrounds.com/", "{username}", defaultName);
                Debug.LogWarningFormat("The url you are trying to load is invalid. Loading default user <color=orange>{0}</color> from:\n{1}.", defaultName, url);
                userpage = UnityWebRequest.Get(url);
            }

            yield return userpage.SendWebRequest();
            if (userpage.isNetworkError) Debug.LogError($"<b>{userpage.error}</b>: {url}");
            else textParserMethod(userpage.downloadHandler.text); // displays data on screen or saves the stats somewhere
        }

And "textParserMethod" to find the user stats list with regexes or preferably a HTML parser.


iu_125061_4428769.png

Response to Newgrounds.io Help & Support 2020-05-26 21:46:22


Are we able to use user's pictures?

I'm able to load a profile picture in Unity's editor, but once I test it live I'm being blocked by a CORS policy.

Not sure if I'm doing something wrong or if that's just how it is outside of hosting on NG.


At 5/26/20 09:46 PM, extrabeans wrote: I'm able to load a profile picture in Unity's editor, but once I test it live I'm being blocked by a CORS policy.


I'm not sure if I understand it correctly, but I don't think you personally can.

You can circumvent it in a way, using CORS proxy of some kind. Simply prefix the icon link like this:

https://cors-anywhere.herokuapp.com/uimg.ngfiles.com/profile/7985/7985576.png

Or in code:

string iconLink = "uimg.ngfiles.com/profile/7985/7985576.png";
const string CorsProxy = "https://cors-anywhere.herokuapp.com/";
string urlPrefix = (Application.platform == RuntimePlatform.WebGLPlayer) ? CorsProxy : "https://"; // don't use it in Editor
string iconUrl = $"{urlPrefix}{iconLink}"; // construct the final url

if (Uri.IsWellFormedUriString(iconUrl, UriKind.Absolute))
{
    StartCoroutine(DownloadIcon(iconUrl));
}
else Debug.LogWarningFormat("The icon url isn't valid: {0}", iconUrl);

iu_126137_4428769.png


It's probably not the best solution, but it works.


Oh, and keep in mind Unity doesn't natively support downloading GIFs – and user icons can be (static) gifs, too – so use something like Unigif in that case. For example, Tom Fulp's icon is a gif if you want to test it.


IEnumerator DownloadIcon(string iconUrl)
{
	using (UnityWebRequest www = UnityWebRequestTexture.GetTexture(iconUrl))
	{
		yield return www.SendWebRequest();
		if (www.isNetworkError || www.isHttpError)
		{
			Debug.LogWarning(www.error);
		}
		else
		{
			// Debug.Log("Downloaded a texture at: " + iconUrl);
			Texture2D texture = null;
			if (iconUrl.EndsWith(".gif", StringComparison.OrdinalIgnoreCase))
			{
				//! Unity doesn't natively support GIF textures; only JPG and PNG
				byte[] gifBytes = www.downloadHandler.data;
				yield return StartCoroutine(UniGif.GetTextureListCoroutine(gifBytes, (gifTexList, loopCount, width, height) =>
				{
					texture = gifTexList[0].m_texture2d; // *Static* gif texture only
				}));
			}
			else
			{
				//! JPG and PNG
				texture = DownloadHandlerTexture.GetContent(www);
			}			
            // TODO: Do something with the texture now
		}
	}
}

Response to Newgrounds.io Help & Support 2020-06-01 20:29:34


Quick question:

Are any scoreboard submissions posted pre-game release for testing purposes saved when the game is published? The network readout is telling me that the scoreboard calls are successful, but I don't want those scores to still be there when the game's launched because it's impossibly high due to having cheats on.


Banner by @MigMoog

BBS Signature

Response to Newgrounds.io Help & Support 2020-07-28 03:42:35


Hello,


I'm trying to get as per the PDF here (https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/src/master/), however I'm getting an error in regards to some sort of a login call whenever I try running the game inside of unity. Is there a way for me to fix this or is this something that gets automatically fixed when you publish the game since it actually works in browser then?


NullReferenceException: Object reference not set to an instance of an object
io.newgrounds.core.checkLogin (System.Action`1[T] callback) (at Assets/newgrounds.io-for-unity-c/Assets/io/newgrounds/core.cs:565)
NG_Helper.Start () (at Assets/Scripts/NG_Helper.cs:27)

My code at line 27 in the helper script is:

   void Start()
   {
       ngio_core.checkLogin((bool logged_in) => //this is line 27
       {
           if (logged_in)
           {
               onLoggedIn();
           }
           else
           {
               requestLogin();
           }
       });
   }

Response to Newgrounds.io Help & Support 2020-07-28 10:22:06


At 7/28/20 03:42 AM, brin-o wrote: Hello,

I'm trying to get as per the PDF here (https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/src/master/), however I'm getting an error in regards to some sort of a login call whenever I try running the game inside of unity. Is there a way for me to fix this or is this something that gets automatically fixed when you publish the game since it actually works in browser then?

My code at line 27 in the helper script is:


Based on the console log, I'd say it's because it can't find the ngio_core.sessionLoader component – which means you're trying to use it before it's "ready". You need to wrap the call in onReady as well, especially in Awake or Start functions triggered in the same scene as the core.


void Start()
{
    ngio_core.onReady(() => //! THIS
    {
        ngio_core.checkLogin((logged_in) =>
        {
            if (logged_in)
            {
                onLoggedIn();
            }
            else
            {
                requestLogin();
            }
        });
    });
}

If I omit this step, I get the same exact error. Adding the onReady callback is the safest option (to some degree of success, you could also change core script's Start to Awake, or init everything in the main menu, pass it to the following scenes and only use it there).


By the way, you don't really need the checkLogin function on Newgrounds, but it helps

  • If you want to treat people not logged in differently (e.g. asks people to log in to be able to get medals)
  • If you want to test medals inside Unity (you get a prompt once a session asking you to grant a permission, and then you're all set)

Otherwise, NG users are automatically logged in, and if you try to unlock a medal for somebody who's not logged in, it will fail, but won't crash the game or anything.

However, you can't use the ngio_core before it's ready, and wrapping it in the onReady callback makes sure you don't.


Does it help? If you'd like to, I can send you the full script.


Response to Newgrounds.io Help & Support 2020-07-28 10:52:28


At 7/28/20 10:22 AM, RaIix wrote:
At 7/28/20 03:42 AM, brin-o wrote: Hello,

I'm trying to get as per the PDF here (https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/src/master/), however I'm getting an error in regards to some sort of a login call whenever I try running the game inside of unity. Is there a way for me to fix this or is this something that gets automatically fixed when you publish the game since it actually works in browser then?

My code at line 27 in the helper script is:
Based on the console log, I'd say it's because it can't find the ngio_core.sessionLoader component – which means you're trying to use it before it's "ready". You need to wrap the call in onReady as well, especially in Awake or Start functions triggered in the same scene as the core.

If I omit this step, I get the same exact error. Adding the onReady callback is the safest option (to some degree of success, you could also change core script's Start to Awake, or init everything in the main menu, pass it to the following scenes and only use it there).

By the way, you don't really need the checkLogin function on Newgrounds, but it helps
Otherwise, NG users are automatically logged in, and if you try to unlock a medal for somebody who's not logged in, it will fail, but won't crash the game or anything.
However, you can't use the ngio_core before it's ready, and wrapping it in the onReady callback makes sure you don't.

Does it help? If you'd like to, I can send you the full script.


Thank you so much! You saved me here, I was so lost as to what i'm doing wrong. That's what I get when I code at 3am I suppose :d

Response to Newgrounds.io Help & Support 2020-10-10 21:42:57


Hi. I'm trying to add a scoreboard to my game (in Unity3D). I created the scoreboard and made API calls to post and get scores from the same scoreboard. The post score requests always had a successful status, yet I never get any scores from the get request. I can get the scoreboard object itself but the array I get is always empty. I tried to get with period="A" and with period being left out (which defaulted to "D"), and neither way worked. I was testing it in preview mode, if that's relevant.

Response I got from postScore:

{
  "success":true,
  "app_id":"<My app id>",
  "result": [{
    "component":"ScoreBoard.postScore",
    "data": {
      "success":true,
      "scoreboard": {
        "id":9529,
        "name":"Expert"
      },
      "score": {
        "formatted_value":"2",
        "value":2,
        "tag":null
      }
    }
  }]
}

Response I got from getScores:

{
  "success":true,
  "app_id":"<My app id>",
  "result": [{
    "component":"ScoreBoard.getScores",
    "data": {
      "success":true,
      "scoreboard": {
        "id":9529,
        "name":"Expert"
      },
      "period":"D",
      "social":false,
      "skip":0,
      "limit":0,
      "user":null,
      "scores":[]
    }
  }]
}

At 10/10/20 09:42 PM, MayChant wrote: Hi. I'm trying to add a scoreboard to my game (in Unity3D). I created the scoreboard and made API calls to post and get scores from the same scoreboard. The post score requests always had a successful status, yet I never get any scores from the get request. I can get the scoreboard object itself but the array I get is always empty. I tried to get with period="A" and with period being left out (which defaulted to "D"), and neither way worked. I was testing it in preview mode, if that's relevant.


I tried it and ran into the same issue as you ("success" with an empty list), even though the code seemed OK to me.

I don't know if the parameters sometimes behave weirdly or if it was my fault (most likely the latter) but after a few attempts, I ended up with this parameter combination which worked with both live and a (different) preview scoreboard.


(You don't have to use the event; I just use it to feed the scores into a text field.)

public void getScores(int scoreboard_id, UnityEvent<string> onScoresGetEvent = null)
{
	// create the component
	var get_scores = new components.ScoreBoard.getScores
	{
			// set required parameters
			id = scoreboard_id,
			limit = 25,
			// user = ngio_core.current_user,
			period = "A",
			social = false,
	};

	// call the component on the server, and tell it to fire onScoreGet() when it's done.
	get_scores.callWith(ngio_core, result =>
	{
		onScoresGet(result);
		string resultString = result.scores.Cast<score>().Aggregate(string.Empty, (current, score) => current + $"{score.formatted_value}\n");
		onScoresGetEvent?.Invoke(resultString);
	});

	Debug.LogFormat("Attempting to get scoreboard '{0}' data...", scoreboard_id);
}

Handle results:

void onScoresGet(results.ScoreBoard.getScores result)
{
	if (!result.success) return; // or Debug.LogError()
	string scoresString = string.Empty;
	foreach (objects.score score in result.scores)
	{
		// this object contains all the score info, and can be cast to a proper model object.
		// var score = (io.newgrounds.objects.score) s;
		scoresString += $"<b>{score.user.name}</b>:\t\t\t\t{score.formatted_value}\n";
	}
    // Log scores or "None"
	Debug.LogFormat("<b><color=orange>Scores gathered:</color></b> {0}\n{1}", 
					result.scoreboard.name, string.IsNullOrWhiteSpace(scoresString) ? "<color=red><None></color>" : scoresString);
}


Live scoreboard test:

iu_179190_4428769.png


Preview (incremental) scoreboard test:

iu_179191_4428769.jpg


You can see the sample if you add Ngio as a package or just the code here.

iu_179192_4428769.png


At 10/11/20 02:11 PM, RaIix wrote:
At 10/10/20 09:42 PM, MayChant wrote: Hi. I'm trying to add a scoreboard to my game (in Unity3D). I created the scoreboard and made API calls to post and get scores from the same scoreboard. The post score requests always had a successful status, yet I never get any scores from the get request. I can get the scoreboard object itself but the array I get is always empty. I tried to get with period="A" and with period being left out (which defaulted to "D"), and neither way worked. I was testing it in preview mode, if that's relevant.
I tried it and ran into the same issue as you ("success" with an empty list), even though the code seemed OK to me.
I don't know if the parameters sometimes behave weirdly or if it was my fault (most likely the latter) but after a few attempts, I ended up with this parameter combination which worked with both live and a (different) preview scoreboard.

(You don't have to use the event; I just use it to feed the scores into a text field.)
Handle results:

Live scoreboard test:

Preview (incremental) scoreboard test:

You can see the sample if you add Ngio as a package or just the code here.


That worked, thanks! Seems like I was missing either social = false (which is weird because the user should be able to see their own score anyway) or limit = 10 (which was the default according to the documentation so maybe it's a bug?). How did you do the live scoreboard testing though?

Response to Newgrounds.io Help & Support 2020-10-12 01:55:16


At 10/11/20 08:33 PM, MayChant wrote: That worked, thanks! Seems like I was missing either social = false (which is weird because the user should be able to see their own score anyway) or limit = 10 (which was the default according to the documentation so maybe it's a bug?). How did you do the live scoreboard testing though?


Glad to hear it. Yes, it's weird, because I also thought those values would be the default.

There's no trick behind the live scoreboard; I simply have access to a scoreboard of an already published game. :)

There seems to be no difference. But in the old project system, you were able to see medals/scoreboards on the game's page even in the preview mode, so hopefully, that will come back at some point.

Response to Newgrounds.io Help & Support 2020-11-20 12:43:44


Out of curiosity, could a downloadable game use the Newgrounds passport? Let's say a Haxeflixel windows target to be specific. I've used the passport to test games from an engine, so I'm guessing it works the same.

My thinking is that, theoretically, a downloadable version of a game shouldn't be inferior to the web version because you're not able to unlock medals or post scores.


Banner by @MigMoog

BBS Signature

Response to Newgrounds.io Help & Support 2020-11-20 13:36:18


At 11/20/20 12:43 PM, BobbyBurt wrote: Out of curiosity, could a downloadable game use the Newgrounds passport? Let's say a Haxeflixel windows target to be specific. I've used the passport to test games from an engine, so I'm guessing it works the same.
My thinking is that, theoretically, a downloadable version of a game shouldn't be inferior to the web version because you're not able to unlock medals or post scores.


Yeah, as long as you are able to make calls to the api and launch a browser to get to the passport login, it should work fine in a downloadable game.

Response to Newgrounds.io Help & Support 2020-11-30 10:28:04


Is there any chance of something being made for Adobe Animate, as that has a HTML5 canvas? I don't know if the Newgrounds.io is compatable with it, just wanted to ask the question! Thanks :)

Response to Newgrounds.io Help & Support 2020-11-30 11:30:25


At 11/30/20 10:28 AM, Little-Rena wrote: Is there any chance of something being made for Adobe Animate, as that has a HTML5 canvas? I don't know if the Newgrounds.io is compatable with it, just wanted to ask the question! Thanks :)


In theory, you should be able to include the html5/JavaScript library. I've never actually used Animate though to say for sure.

Response to Newgrounds.io Help & Support 2020-11-30 11:41:06


At 11/30/20 11:30 AM, PsychoGoldfish wrote:
At 11/30/20 10:28 AM, Little-Rena wrote: Is there any chance of something being made for Adobe Animate, as that has a HTML5 canvas? I don't know if the Newgrounds.io is compatable with it, just wanted to ask the question! Thanks :)
In theory, you should be able to include the html5/JavaScript library. I've never actually used Animate though to say for sure.


I gave it a go, but couldn't work it out, I am not good with relearning, but I need to move on from Flash, trying to get into HTML5, so using various tools to see which ones I can get the hang of as much as I did with Flash. I'll have another bash at animate, for now, I am trying GameMaker Studio 1.4, wish me luck, otherwise I am going to go back to my cave, and using AS2.

Response to Newgrounds.io Help & Support 2020-11-30 11:51:19


At 11/30/20 11:41 AM, Little-Rena wrote:
At 11/30/20 11:30 AM, PsychoGoldfish wrote:
At 11/30/20 10:28 AM, Little-Rena wrote: Is there any chance of something being made for Adobe Animate, as that has a HTML5 canvas? I don't know if the Newgrounds.io is compatable with it, just wanted to ask the question! Thanks :)
In theory, you should be able to include the html5/JavaScript library. I've never actually used Animate though to say for sure.
I gave it a go, but couldn't work it out, I am not good with relearning, but I need to move on from Flash, trying to get into HTML5, so using various tools to see which ones I can get the hang of as much as I did with Flash. I'll have another bash at animate, for now, I am trying GameMaker Studio 1.4, wish me luck, otherwise I am going to go back to my cave, and using AS2.


Godspeed!


Wah, I tried to use the Newgrounds.io API in Wick (it uses Javascript so I just copy-pasted from here) but it gives me an unexpected error when trying to give a Medal.


Console output:

Medal.getList: 7
Get Medal " EZPZ " ID...
Medal Found! EZPZ = 62301
Error@Medal.unlock( This is Fine ): Unexpected Server Response


Code:

ngio.getValidSession(function() {
    if (ngio.user) {
        var medals = null;
        ngio.callComponent('Medal.getList', {}, function(result) {
            if (result.success) {
                medals = result.medals;
                unlockMedal("EZPZ", medals);
            }
        });
    }
});

var unlockMedal = function(medal_name, medals) {
    if (ngio.user) {
        var medal;
        for (var i = 0; i < medals.length; i++) {
            medal = medals[i];

            /* look for a matching medal name */
            if (medal.name == medal_name) {
                console.log('Medal Found!', medal_name, '=', medal.id);
 
               /* we can skip unlocking a medal that's already been earned */
                if (!medal.unlocked) {
                    /* unlock the medal from the server */
                    ngio.callComponent('Medal.unlock', {id:medal.id}, function(result) {
                        if (result.success) {
                            console.log('Medal.unlock(', medal, '):', result);
                        } else {
                            console.log('Error@Medal.unlock(', medal.name, '):', result.error.message);
                        }
                    });
                }
            }
        }
    }
}


Why is NGIO trying to give the wrong Medal? (EZPZ = 62301, first Medal, This is Fine = 62303, last Medal)

It's like calling Medal.unlock changes the medal object. Or could it be some async bullhickie?


"Hold me Gently, Kiss me Plenty!"

BBS Signature

Edit: Splitting the for-cycle from the ngio.callComponent('Medal.unlock' kept the right Medal but it still failed.

Error@Medal.unlock( EZPZ ): Unexpected Server Response

"Hold me Gently, Kiss me Plenty!"

BBS Signature

Response to Newgrounds.io Help & Support 2021-02-26 10:08:35


At 2/25/21 04:46 PM, Titilonic wrote: Edit: Splitting the for-cycle from the ngio.callComponent('Medal.unlock' kept the right Medal but it still failed.


I'm not sure if it's something Wick-specific. When I did medal unlocking in Phaser (which is JavaScript) I vaguely remember running into issues and ultimately got it working with a far simpler approach. This code unlocked any of three medals if conditions were met:

    if (ngio.session_id != null) {
      if (wonZoom + wonNoZoom > 0) {
        ngio.callComponent('Medal.unlock', {id: 58963});
      }
      if (wonZoom + wonNoZoom == buttonSprite.length) {
        ngio.callComponent('Medal.unlock', {id: 58964});
      }
      if (wonNoZoom == buttonSprite.length) {
        ngio.callComponent('Medal.unlock', {id: 58965});
      }
    }

The only way to verify that the medals are working with this approach is to go to your project page on NewGrounds where your medals are listed and see if right now they still say something along the lines of Untested and then change to Approved after you run the game with that code.


My newsfeed has random GameDev tips & tricks


At 2/26/21 10:08 AM, 3p0ch wrote:
At 2/25/21 04:46 PM, Titilonic wrote: Edit: Splitting the for-cycle from the ngio.callComponent('Medal.unlock' kept the right Medal but it still failed.
I'm not sure if it's something Wick-specific. When I did medal unlocking in Phaser (which is JavaScript) I vaguely remember running into issues and ultimately got it working with a far simpler approach. This code unlocked any of three medals if conditions were met:
The only way to verify that the medals are working with this approach is to go to your project page on NewGrounds where your medals are listed and see if right now they still say something along the lines of Untested and then change to Approved after you run the game with that code.


I see. Thanks, I'll try it without return functions.


"Hold me Gently, Kiss me Plenty!"

BBS Signature

Also, please update the demo, It's medals[i], not medal[i]. As well as my problem where the asynchronous call (ngio.callComponent) was slower than the for loop. Here's my corrected code:

    if (ngio.user) {
        console.log('Get', medal_name, 'ID...');
        for (var i = 0; i < medals.length; i++) {
            medal = medals[i];

            /* look for a matching medal name */
            if (medal.name == medal_name) {
                console.log('Medal Found!', medal_name, '=', medal.id);
                break;
            }
        }
        
        if (medal === null) {
            console.log('No Medal found');
            return;
        }

        /* we can skip unlocking a medal that's already been earned */
        if (!medal.unlocked) {
            console.log('Unlock', medal.name);
            /* unlock the medal from the server */
            ngio.callComponent('Medal.unlock', {id:medal.id});
        } else {
            console.log('Have medal:', medal);
        }
    } else {
         console.log('Error@ngio.getValidSession')
    }


The issue might be related to this, too.


"Hold me Gently, Kiss me Plenty!"

BBS Signature

At 2/26/21 12:46 PM, Titilonic wrote: Issues and Stuff


Got it working (the Javascript API) and here's what I learned:

  • Any of the APIs from newgrounds.io is v3.0 so you need to follow these instructions to get the right secret (this was my problem)
  • Neither Gateway.Datetime, getValidSession or Medal.getList actually use the secret, thus the confusion
  • The error is an undefined response on the browser's Console but the Network tab will tell you in detail what the response was (not sure if you need debug = true first)
  • Using the Javascript API in the Wick Editor works fine


Sorry for over-posting because of this.


"Hold me Gently, Kiss me Plenty!"

BBS Signature

I'm adding a new Unity3D game to Newgrounds with medals. I've done this before about a year ago with no issues. Now all of a sudden I was getting exceptions in the editor:

NullReferenceException: Object reference not set to an instance of an object
io.newgrounds.core._createCall (System.String component, System.Object parameters, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:296)
io.newgrounds.core.callComponent (System.String component, System.Object parameters, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:317)
io.newgrounds.components.Medal.unlock.callWith (io.newgrounds.core core, System.Action`1[T] callback) (at Assets/Newgrounds IO/io/newgrounds/components/Medal.cs:94)
GameManager.NgProcessMedalQueue () (at Assets/Scripts/GameManager.cs:358)
GameManager.NgOnReady () (at Assets/Scripts/GameManager.cs:342)
io.newgrounds.core.onReady (System.Action callback) (at Assets/Newgrounds IO/io/newgrounds/core.cs:74)
GameManager.NgRegisterAPI () (at Assets/Scripts/GameManager.cs:336)
GameManager.Start () (at Assets/Scripts/GameManager.cs:97)


I also hit an error when previewing the game on Newgrounds:

"Unable to cast object of type 'ResultModel' to type 'unlock'."


I already have medal unlocks sit in a queue until NG.IO reports ready.


Turns out there was a recent change to NG.IO which is incompatible with how I was using it:

https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/pull-requests/1


core.cs changed from `Start()` to `Awake()`


I don't use NG.IO in the way recommended by the guide. Rather than creating an object in my scene editor with the required properties, I create a new object at the start of the game and fill in the properties. This way, I can initialize it at runtime only if I'm exporting a build for Newgrounds (vs some other site or standalone). For some reason, the change to `core.cs` makes this no longer work.


FYI for anyone who hits this error in the future. Solution in my case was just to switch core.cs back to Start()

Response to Newgrounds.io Help & Support 2021-05-08 16:21:43


At 8/1/16 01:58 PM, PsychoGoldfish wrote: Newgrounds.io is the successor to the old Newgrounds Flash API. We've completely re-built the server API to remove all dependencies on custom ActionScript classes.

Now, ANY platform should be able to use the API. The only requirements are the ability to encode and decode JSON objects, and post over HTTP.

Newgrounds.io is launching it's public beta today. We already have some libraries available for platforms that target HTML5, and complete documents on how you can build your own libraries from any other platform.

Newgrounds.io is going in to public beta today, so if you start using it, and need help or support, post in this thread and we'll get back to you as soon as we can.

If you plan on implementing Newgrounds.io into a platform we haven't covered yet, you should also check out the Newgrounds.io Developers Group. I'll be posting any major updates to the server API in there, so joining the group will keep you in the loop.

Now, before anyone DOES post for help in here, make sure you have already checked the Getting Started and Help pages on www.newgrounds.io, or the help documents for any Newgrounds.io libraries you are using. There's a lot of useful information already out there.

If you are interested in in-game ads, we will not be adding those to this API. The old Flash API often had issues with ad-blockers because they would occasionally block access to the entire API server, and we do not want a repeat of that with Newgrounds.io.

At some point, we will be looking at creating a standalone API for implementing ads in games, so keep your eyes open for that.

Also, we haven't implemented any NEW features at the time of this post, we were primarily concerned with updating the network interface and encryption options so the whole thing is a lot more platform agnostic.

The 'save data' feature is still being rebuilt (the old version was VERY Flash-oriented), and is not currently available. When it becomes available I'll post about it in here and in the developer group.

You can also follow the project on Twitter, I'll be posting news and changes there as well.


Do you know why none of the icons like the search icon are not showing?


Response to Newgrounds.io Help & Support 2021-07-19 13:45:23


Hey there, I have a bit of a problem regarding uploading art. Whenever I try to upload art, I'm greeted with thisiu_361824_8363998.png

Did I do something bad? Was this a glitch in Newground's servers or something?

I'm not very tech savvy so I don't know what word to use, hence the usage of the word "server"

I really hope this is just a glitch and that I didn't do anything to fuck up my account here on Newgrounds.

Response to Newgrounds.io Help & Support 2021-07-19 14:16:42


At 7/19/21 01:45 PM, GrayFoxBoi wrote: Hey there, I have a bit of a problem regarding uploading art. Whenever I try to upload art, I'm greeted with this
Did I do something bad? Was this a glitch in Newground's servers or something?
I'm not very tech savvy so I don't know what word to use, hence the usage of the word "server"
I really hope this is just a glitch and that I didn't do anything to fuck up my account here on Newgrounds.


Should be fixed now