How to get Steam overlay and achievement working on NWjs

2

Stats

3,727 visits, 5,348 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 4 Aug, 2019. Last updated 23 Jul, 2023

I've been asked by some of the community users to write a guide for getting Steam overlay and achievements working under NWjs, so here goes.

I tested it on linux and windows, it should work on osx, but I can't confirm it.

Things to know:

1. It doesn't matter what C2/C3 version you're using.

2. You must always make sure the NWjs version your using is compatible with the greenworks version and the steamworks SDK version.

Step One - Get C2/C3 greenworks plugin

Download the latest C2 greenworks plugin and install it.

construct.net/en/construct-2/addons/83/greenworks

Current latest version link

construct.net/construct-2/addons/83/greenworks/0-30-4-76/greenworks-0.30.4-stable.c2addon

Notice the version in the file name and link 0.30.4 that's the version of NWjs the plugin works with.

Download the latest C3 greenworks plugin and install it:

construct.net/en/make-games/addons/84/greenworks

Step Two (optional) - Manually check for higher greenworks api version

C2 greenworks plugin is not always up to date, currently there is a greenwork api version 0.14 which can work with NWjs 33.3 and a new one is on the way.

To manually update your C2 plugin, download the latest greenwork api for all the platforms (win32, win64, linux32, linux64, osx)

github.com/greenheartgames/greenworks/releases

Daily builds are now available at:

greenworks-prebuilds.armaldio.xyz

Extract the files to a temp directory, copy all the files from the 'lib' directory to the root of your plugin directory (you would be asked to overwrite them, since the old versions are already there).

Plugin directory is located under C2 install directory, default is:

\Program Files\Construct 2\exporters\html5\plugins\greenworks

The greenworks.js file is the same on all platforms, get one of them, edit it and remove 'lib/' from all 6 require links at the top of the file, example:

This:

greenworks = require('./lib/greenworks-osx64');

Should be this:

greenworks = require('./greenworks-osx64');

Save it and copy it to the C2 plugin directory.

Now you got an updated plugin that works with an higher version of NWjs

Step Three - Get NWjs

You can get NWjs from the C2 website here:

scirra.com/nwjs

Note there might be higher/newer version of NWjs available, but you must use the exact same version the greenworks API version is working with.

Sometimes C2 will fall behind on NWjs updates, you can get your own from the link below, but you would need to do some file cleaning.

nwjs.io/downloads

C2 is using the SDK version by default, but I like to use the NORMAL version, because it is blocked to devtools and debuggers.

If you're using the SDK version, you can block devtools by adding an arg to the package.json file inside the package.nw file

--disable-devtools

Just add it the the end of the chromium-args string before the closing quotes and don't forget to add a space before it.

Extract the NWjs file to a temp directory and compare each of the OS directories with the C2 NWjs directory

\Program Files\NWjsForC2\

Remove all the files that are not in the C2 NWjs directory. These are unnecessary devtools files, that serves no function in running the game.

You can replace the files in the C2 NWjs directory with the downloaded files, or just copy them to straight to your steam game upload directory.

You don't need to update them every time, only if you upgrade/downgrade versions.

The only thing you need to update with new exports is the package.nw file.

Step Four - Get Steamworks SDK

Look in the description of the greenworks api version you downloaded, it will show you what version of steamworks sdk to use.

github.com/greenheartgames/greenworks/releases

Log in into your steam partner account, on the right sidebar you will see the sdk download links, download the right version.

After exporting your game in construct, locate the package.nw in the OS directory you're using and copy in the dll file for that OS.

The files are located in the sdk zip file under

\sdk\public\steam\lib\</p>

Step Five - Steam ID file

In the root of your game directory (where the exe file is), create a file named steam_appid.txt

And write your game ID number inside it.

Your game ID is most easily found on at the end of your steam store page link:

store.steampowered.com/app/ID/Game_Name/

Step Six - chromium-args

Edit the package.json file found inside your exported package.nw file

And add this arg to the end of the string before the closing quotes and don't forget to add a space before it :)

--in-process-gpu

Step Seven - Add plugin and test

Load up you game capx, add the greenworks plugin and add an action to Active achievement.

You can't test Steam features in preview!

Export your game and make sure all the files are in order, copy the game directory to your Steam library directory (\SteamLibrary\steamapps\common\).

Run the game from within the Steam client!

You will now have access to steam overlay in your game, access with the usual steam keyboard shortcut or by forcing with the greenworks plugin action.

  • 6 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • What is package.json file and how do you edit it? Oh by the way you can't download older versions of the Steam SDK so I think most of this stuff is extinct.

  • Thanks a lot. It's a great tutorial. But mine is only working with steam overlay, not achievements. Do you have any clue what went wrong? I used greenworks 14, steamworks sdk 142 and nwjs 33.3(or 30.4)...

    • hi gaminslab you try again? its work or not

    • It's hard to guess without taking a look.

      Make sure you didn't miss any file and that they are all in their right place (you can share a dir list, if you want me to take a look).

      Make sure you wrote the right appid in the steam file and that there are no extra characters or spaces.

      Make sure the events are actually trigger (print log), make sure the achievement ids are correct and that the achievements are all published (not waiting for review) on your steam app admin page.

      You can also try and see if any errors are printed to the console log.