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!
Response to: Unity3d WebGL Support Posted June 22nd, 2020 in Game Development

At 6/22/20 07:03 PM, RaIix wrote:
At 6/22/20 03:38 PM, BlueStarGeneral wrote: Can only test on NG with the preview build if that makes a difference.
So, it works on NG, but not in the Unity Editor?
(Because it'd make sense – you're logged in on NG, but not in the Editor which needs to be granted the permission first.)

At 6/22/20 03:56 PM, BlueStarGeneral wrote: void LateUpdate()
{

if(!executed && ngio_core)
{

// Do this after the core has been initialized
ngio_core.onReady(() => { 

// Call the server to check login status
ngio_core.checkLogin((bool logged_in) => {

if (logged_in) 
{
OnLoggedIn();
executed = true;
}
else 
{
/*
* This is where you would ask them if the want to sign in.
* If they want to sign in, call requestLogin()
*/
}
});
});

}

}
I didn't try your code, but by the look of it, it'd make sense why it doesn't work in the editor.
"ngio_core.checkLogin / bool logged_in" will be false when you open the Editor, and since the "else" branch is empty, the code does nothing.

You need to actually call the commented-out ngio_core.requestLogin function (with the callbacks if you want – e.g. set the 'executed' bool to true in the first one), which will open the browser and tell you to log in (or grant permission).

I'd take a look at the visual guide by GeckoMLA19097 if you get stuck. It's fairly detailed and shows all the code you need to set up a simple medal / scoreboard system.

I think you don't need to deal with the login bit either, if you don't want to. It only gives logged-out players an option to sign in and makes sure you can test the medals and score directly from Unity.
If you don't need that, the rest should work for logged-in players on NG nevertheless. Assuming the ngio_core has been initialised (is "ready"), this will work fine:


I've just uploaded 'Dust star Speedway' which uses the code. It does upload scoreboards, in a strange format, I tried using milliseconds relative to 1000f and 60f but displays odd results if you check the game it says 'Logged out' as thats the check for the above code. Either way it is functional, but testing it in the preview build is an issue. Like I said Getting this to work with Unity's stuff won't be all that easy but, I'm still a big believer in browser based games and NG!


PSD

Response to: Unity3d WebGL Support Posted June 22nd, 2020 in Game Development

At 6/22/20 03:38 PM, BlueStarGeneral wrote:
At 3/28/18 05:25 AM, JmPrsh153 wrote:
At 5/12/15 12:04 PM, PsychoGoldfish wrote: Having problems with your Unity3D WebGL game? Please start here. If you've read through the wiki, searched Google, etc. and still haven't resolved your issue, feel free to ask a question here.
i have made a post here about my recent game build :/ please help! https://www.newgrounds.com/bbs/topic/1430847
Doesn't work can't even log in, did everything mentioned to the last letter and double/triple checked over six hours of testing. Can only test on NG with the preview build if that makes a difference.

PSD


I put it into lateupdate also to make sure the packet doesn't go missing, that runs on my game at 200FPS, still no connection. I'm not blaming anyone as getting this to work with unity stuff isn't easy but ...just dis-appointing....I really wanted scoreboards and to add to the NG website.


void LateUpdate()

{


if(!executed && ngio_core)

{


// Do this after the core has been initialized

ngio_core.onReady(() => { 


// Call the server to check login status

ngio_core.checkLogin((bool logged_in) => {


if (logged_in) 

{

OnLoggedIn();

executed = true;

}

else 

{

/*

* This is where you would ask them if the want to sign in.

* If they want to sign in, call requestLogin()

*/

}

});

});


}


}

Response to: Unity3d WebGL Support Posted June 22nd, 2020 in Game Development

At 3/28/18 05:25 AM, JmPrsh153 wrote:
At 5/12/15 12:04 PM, PsychoGoldfish wrote: Having problems with your Unity3D WebGL game? Please start here. If you've read through the wiki, searched Google, etc. and still haven't resolved your issue, feel free to ask a question here.
i have made a post here about my recent game build :/ please help! https://www.newgrounds.com/bbs/topic/1430847


Doesn't work can't even log in, did everything mentioned to the last letter and double/triple checked over six hours of testing. Can only test on NG with the preview build if that makes a difference.


PSD

Response to: Warfare - Situation 1 - Invasion. Posted March 5th, 2012 in General

You worried about the Chinese or something? I can't see any ground wars in the west due to the 'nuclear deterrent'. It's highly likely that any war would be a civil one, largely the masses taking on the government. In which case what side would you be on? In any case I'd haul ass as well, if I woke up in a war zone, what else could you do.

P