(HELP!) Anyone using the Newgrounds.io Javascript library directly in C3?

0 favourites
  • 2 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm kind of stuck on a project currently. I need to use the antisuspend plugin to keep multiplayer from missing messages if the player is tabbed out (has been creating issues with my turn based game), but it requires worker mode and the newgrounds api plugin ports require worker mode disabled.

    So I'm trying to utilize the new Newgrounds.io javascript library, but as I'm not very skilled at javascript I'm not sure how to get going. After two hours of labor all I've managed to accomplish is getting it to open the log-in window. I'm now stuck on trying to set a global variable to the logged in user's name ><

    So I'm reaching out to any fellow Newgrounds developers: Have you begun using the new javascript library in your games? How are you doing it? If anyone has examples I can look at I would greatly appreciate it!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Unless it's something construct-specific you probably have better luck asking on the newgrounds forum or their Discord. See bottom of the page here newgrounds.io/help

    Setting a global variable should be relatively easy to do. I'd assume the newgrounds API probably returns it along with some other values. Probably a JSON object.

    Your code should look something like this (I did not look at how this actually works, I'm mostly guessing here)

    var newgrounds = [login call];
    runtime.globalVars.yourvariable = newgrounds.username;
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)