Update 26th February 2018: The Greenworks plugin is now available on the new Addon Exchange. Find it here:
https://www.construct.net/construct-2/addons/83/greenworks
All future updates to the plugin will only be published there.
Hi folks,
If you're after Steam integration with NW.js good news: I've got Greenworks working within a C2 plugin. Here are the downloads (these require C2 r185+, newer NW.js versions require r217+):
Greenworks plugin releases
Greenworks 0.3 alpha - for node-webkit 0.10.x
https://dl.dropboxusercontent.com/u/15217362/greenworks.c2addon
Greenworks 0.4 - for node-webkit 0.11.x
Changes in this update:
- [ADD] 'Is overlay enabled' condition, 'Activate overlay' action
- [CHANGE] Updated to Greenworks-0.4.0 with support for node-webkit 0.11.x; now supports 64-bit OSX and Windows builds
- [CHANGE] New icon
- [FIX] Made 'On achievement success/error' triggers - they previously were not marked as such so probably did not work
https://dl.dropboxusercontent.com/u/15217362/greenworks-0.4.0.c2addon
Greenworks 0.13.0 - for NW.js 0.13+ (updated February 1st 2016)
Changes in this update:
- [ADD] Support for NW.js 0.13+ for win32 and win64 only (note Mac and Linux support is not expected to work in this release).
- [ADD] 'On overlay activated' / 'On overlay deactivated' triggers
- [ADD] GameLanguage and UILanguage expressions
https://dl.dropboxusercontent.com/u/15217362/greenworks-0.13.0.c2addon
Greenworks for NW.js 0.14.7 (2nd August 2016)
Uses the following versions:
NW.js: 0.14.7
Steamworks SDK: 1.37
Note: this version only supports 64-bit platforms (Windows, Mac and Linux 64-bit) - there is no support for 32-bit Windows or Linux.
Download: https://www.construct.net/construct-2/addons/83/greenworks/0-14-7
Greenworks for NW.js 0.15 (2nd August 2016)
Uses the following versions:
NW.js: 0.15
Steamworks SDK: 1.36 (note not the latest version)
Download: https://www.construct.net/construct-2/addons/83/greenworks/0-15-0
Greenworks for NW.js 0.19.4 (20th January 2017)
Uses the following versions:
NW.js: 0.19.4
Steamworks SDK: 1.38a
Note: this release requires adding extra DLL/library files - see updated instructions below.
Download: https://www.construct.net/construct-2/addons/83/greenworks/0-19-4
Greenworks for NW.js 0.26.6 (26th February 2018)
From now on, all Greenworks updates will be available on the Addon Exchange. Click the link below to get v0.26.6 and newer updates:
https://www.construct.net/construct-2/addons/83/greenworks
Support notes
Note if Steam is unavailable or something has gone wrong "is available" will be false, so check it's true before using Steam features. There should be a message in the dev tools console if something went wrong (use the 'Show dev tools' action in the NW.js plugin to check).
Greenworks also doesn't work in preview mode yet, sorry!
Changes after export to get Greenworks working
To get it working you need to make some changes after exporting as NW.js. Note Greenworks does not currently work in preview mode ("is available" will be false).
1a. Add the Steamworks SDK library to package.nw
Package.nw is just a zip file with a different extension. You can open it either by renaming it to .zip, adding a file, then renaming it back to .nw (Windows must be set to show file extensions). Alternatively you can associate the .nw file extension with a program that can open zips like WinRAR and just drag-and-drop extra files in.
Download the Steamworks SDK from the Steam partner site. From the redistributable_bin folder, copy the appropriate file for the platform. For example add steam_api.dll to package.nw for the win32 build, steam_api64.dll for the win64 build, etc.
Note you must match the Steamworks SDK version listed with the Greenworks version! You may have to download an old version of the Steamworks SDK to make sure it's compatible.
1b. Add sdkencryptedappticket library
As of Greenworks for NW.js 0.19.4, you need to add another library file. This can be found in public\steam\lib in the Steamworks SDK. You need to copy this to package.nw in the same way you did for steam_api.dll. For example for the win64 version, copy public\steam\lib\win64\sdkencryptedappticket64.dll to package.nw.
2. Make sure the executable filename is nw.exe
For some reason it doesn't work if the executable file has a different name. So make sure the main executable filename is exactly nw.exe. You can always use a shortcut to hide the real name of the executable.
3. Create a text file named steam_appid.txt in the same folder as nw.exe
The steam_appid.txt file should contain nothing but your app ID on Steam. If you don't have one yet, for testing you can use Construct 2's app ID of 227240. You must also have Construct 2 installed on your copy of Steam. It can be the free edition, and it works fine side-by-side with a non-Steam install. (If the app ID is not valid and installed, Greenworks won't work.) Also make sure the file has an ANSI/ASCII encoding in your text editor, otherwise it may put a UTF-8 BOM at the start of the file.
4. Make sure Steam is running and you are logged in to Steam
Greenworks requires Steam to be running in the background with a logged in user to work.
5. Start the app and check Greenworks features work.
Remember: you must match all the versions of Greenworks, NW.js, and the Steamworks SDK. If anything goes wrong use the 'Show dev tools' action to check the browser console.