Advanced users tutorial: Unlockable Steam achievements

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,294
Reaction score
1,270
First Language
Finnish
Primarily Uses
RMMV
Warning, this is for advanced users only. This is NOT a plug and play, you do need to know what you're doing or else your achievements won't work.

If you still need help setting this stuff up and cannot make this on your own, I can offer assistance with my publisher services

Prequisities

  • Steam Appid for your VN which you can pay for at Steamworks (Costs about 80€).
  • Active Steam account with which to test your achievements on
  • Understanding of Steamworks, depots and branches, this is not a tutorial how to setup your game on Steam
  • Understanding of at least basic levels of Javascript for debug purposes
  • Understanding of basic computer terminology such as root folder

Preparations

Download the following zips

  • https://dl.nwjs.io/v0.26.6/ <- Pick SDK version for the OS that you use. The SDK will be used to test your achievements and functionality, when actually releasing your games you want to use the regular version instead.
  • https://github.com/greenheartgames/greenworks/releases <- Pick the 0.266.6 version for the OS that you use
  • Steamworks SDK version 1.41 <- You can find this when you become steam partner under "View SDK change notes"
Go to Steamworks and create a new achievement. For purposes of this, call it "Test" without brackets. Be sure to publish your changes or else it will not be obtainable.

Error Check: Make sure you don't have brackets in your api name.

Scripting

Make a new Coffee Script in your VN, call it "Achievements" or something as equally easy to identify. Copy and paste this code exactly as is.

Code:
greenworks = (require||requireNode)("./greenworks")
greenworks.init()
Next, go to the scene where you want to insert your achievement. For purposes of the test, we'll go to the very first scene, at the top of the load order. Now, use script call and use

Code:
greenworks.activateAchievement("Test", function() { console.log("Success!")}, function(err) { console.log(err) })
You replace "Test" with the name of Api name you have setup in the previous step.

Error check: Make sure you have quotation marks in the script call around your achievement's Api name.

Export project

Now export your project as you normally would. Then go to the exported folder and do the following
  • Replace all files with the ones from your downloaded Nw Js version. Delete Game.exe
  • Export the contents of greenworks into the root of the exported folder
  • Open your Steamworks SDK and go to redistributable bin. Go into the folder of the OS you run and copy the contents in the lib folder of your exported project's root folder that contains greenworks node file.
  • From the SDK, go to public->Steam->lib->your OS-> and copy all the files inside to the place with greenworks node.
Next, go to your project's root folder and create a text file called "steam_appid" exactly like that. Inside, only write your appid number, nothing else.

Error check: Make sure you have extensions visible and that your full text file name with extensions should be "steam_appid.txt"

Testing the project

Run nw.exe and press F12.

Run the following console command

Code:
console.log(greenworks.getAppId())
Make sure the AppId is correct, if it is not you need to go back and check your steps, you've done a goof somewhere.

Next, start a new game while still having the console window open. It should tell you "Success!" but if it says anything but that, you need to address the issue.

If you now go to your Steam library and check the game out, it should tell you that you've gotten the achievement. Congratulations, you've done it! Now, all you need is copy the rest of the achievements and set each of them the same way.
 

gRaViJa

Veteran
Veteran
Joined
Mar 16, 2012
Messages
782
Reaction score
282
First Language
Dutch
Very valuable information! I bookmarked it in case I ever get to the state where I need this :)
 

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,294
Reaction score
1,270
First Language
Finnish
Primarily Uses
RMMV

kory_toombs

Villager
Member
Joined
Oct 18, 2013
Messages
19
Reaction score
17
First Language
English
Primarily Uses
How is it out of date?
The files you suggest are older than the ones I have suggested and linked.

My tutorial is not the same as yours...
-Screen Shots
-More written details
-I discuss files you need from the SDK, which is not mentioned at all in your tutorial.
-How to make achievements within the Steam Works Partner app.
-A link to my other tutorial on how to set up a game with the SDK.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

i watched the sonic movie it was pretty good i hope they make a sequel
tomorrow I'ma go on a cruise for the first time ever... lets hope I'll survive the experience!
Omg! 8 years in this forum :o
Ksi
Streaming the last of the RMN Valentiny event games so feel free to drop on by and watch me cry (whether that's from laughter, rage or sheer pain, who knows?)
Today I went to sleep without setting an alarm, so I could sleep more than 2 hours. I woke up after 2 hours.

Forum statistics

Threads
94,309
Messages
919,828
Members
124,060
Latest member
jloppnow
Top