Can't get Steam achievements to work in RMMZ

Okay ... I have been trying this for literal months now. T_T
I suspect there might be a logical error, or I don't get some necessary basics, so please let me guide you through my process and through what I already tried. If you read ANYTHING you find strange, please interject! xD'
I'm aware this thread is a lot! Even though I'm not the most tech-savvy, I put a LOT of research into the topic and would be immensely thankful to anyone who takes a closer look! =]



Version: RPG Maker MZ
Game: Vom Drachentöten. German only for now, but that should be irrelevant for this thread.
Plugin: NekoGakuen. I also tried this option before, but to no avail.
Important (?) context: The game uses only RTP assets and no other plugins at all. (It was a first experiment in minimalism.) It was already online when I started trying out achievements, so after a few failed attempts, I set up the playtest version I'm using right now. It's identical to the steam version online, and that one didn't work either.



Step 1.
In the RPG Maker, I installed the plugin and set it up as follows.

Nek1.jpg

(This is the ID of the playtest version, the actual game online has a different one.)


Step 2.
To test out achievements, I set up a few in steam and added a testing event in the game, using the Plugin Commands by NekoGakuen.

Nek8.jpg
Nek2.jpg

I tried out the Command with a common event as well as the one without. I also added a switch that checks if the achievement has been called. (Never got back a positive!)

The achievements do show up on the steam page (of the playtest)!

Nek9.jpg


Step 3.
NekoGakuen has a very handy guide in their download files. Following that, I got all the stuff I need and set it up accordingly. (More about the versions in a moment!)
The relevant folders and documents look like that:

Nek10.jpg
Nek4.jpg
Nek5.jpg
Nek6.jpg

Now, crawling threads online, I'm aware that different versions of this stuff are the most likely source of error.
Greenworks.js and the SDK have been downloaded only the day before yesterday, but I also tried with versions from a few months ago.
When it comes to the versions of the greenworks nodes and NW.js, I have tried A LOT of combinations, among else the following ones:
  • The recent version of nw.js and the fitting node: v0.90.0 + v127
  • The versions NekoGakuen uses in the TEXT of their guide: 0.49.1 + v83
  • The versions NekoGakuen uses in the PICTURES of their guide: 0.62.2 + v102 (instead of v99 which has been cycled out it seems)
  • The versions that fit the RMMZ's own NW.js best: v48.04 + v83
I also tried updating the NW.js of the RMMZ, but to no avail.


Step 4.
I set up the launch options of the game on steam, according to the guide.

Nek7.jpg

Now, what might be important here: I'm using the direct upload function of steamworks, not the complex content builder. (My game is small and has, for now, only one version.) Uploading looks as following, and in the end, this is my extensive build history ...

Nek11.jpg
Nek12.jpg

Just in case somebody asks, I DID publish the changes. ^^


Results.
There are no results. (duh!) I tried out the event in any order, but there was never any action with the achievements, in any version I tried out.
Also interesting: I do not have a steam overlay, in general. The game works fine through steam (I never got any complaints, and there are a lot of nice reviews!), but there seems to be no connection at all?

I also read that you can use the NW.js versions "with SDK" to get developer tools, but that doesn't work either. SHOULD I be able to open a console when I play on steam, using the DevTools-version of NW.js?

Accordingly, the following is only from the rpg maker directly, before the steam integration.

Nek14.jpg

The following one pops up if I try to call the steam achievement overlay with a NekoGakuen Plugin Command. (Which makes sense because the version does not yet have steam integration, I guess ...?)

Nek13.jpg

Now, the last idea I haven't tried is using the content builder instead of the direct upload, but to be honest, that would kind of overkill and I AM quite intimidated by anything that looks too much like programming ... xD' (But I'm also ready to engage, of course.) So if you think that might help or have other ideas, thanks a lot in advance! =]

And thanks for reading... !!!
I'm not an expert, but ehm... could it be your greenworks.js file is in the wrong place?

Typically it should be in the /js/libs folder.
I'm not an expert, but ehm... could it be your greenworks.js file is in the wrong place?

Typically it should be in the /js/libs folder.
According to the NekoGakuen guide, it should be correct that way. (picture)
But I might try later nevertheless.

Thanks for your reply!
Well the error message is quite literal, but doesn't make sense because ./greenworks.js is right there.
By the way can you move you project to a simple directory?
For example D:\project1, avoid using space and none alphabetical characters.
I was able to get Steam achievements working a couple months ago using NekoGakuen's plugin and guide. According to my notes, I'm using NW.js version 0.49.1 (the default MZ NW.js version didn't work), Steamworks SDK 1.5.0 and greenworks v83, all for Windows 64-bit.

Comparing your folders to mine, I did rename the greenworks node file in the lib folder to greenworks-win64.node (that's what it's called in the guide too and I had seen in a forum post somewhere that someone had to rename it).

Like you, I'm using the direct upload option in Steam, so I don't think there's a problem using that.
Okay, first: Thanks A LOT!
I am (was?) not only massively optimistic after these posts, especially @SeaPhoenix is also giving me hope that it CAN in fact work, and that I might be quite close after all! xD'



But alas, I tried some of the more obvious things in small steps, to no avail. T_T
Chief among them ...
  • changing the name of the node, keeping the newest versions of everything else: the game crushes immediately
  • changing the name of the node, using SeaPhoenix' whole set-up: game works, but no achievements (so exactly as before)
  • saving the project directly on my hard drive, with different set-ups: still no achievements. New error message:
Nek21.jpg

One interesting tidbit: Trying to call the achievement screen (part of the steam overlay) with the appropriate Plugin Command crashes the game and gives the following error message:

Nek22.jpg

(I do not know if this means anything.)



Let me add some questions to rule out mistakes:
  • I'm always trying around with the greenworks nodes, but could the version of "greenworks.js" (which is seperately downloaded) be relevant?
  • I stayed with SDK version 1.6 (the recent one) instead of downgrading to 1.5. Could this be a problem? I ask instead of trying out because it seems to me the problems might come from elsewhere.
  • One mainly for @SeaPhoenix : When you say "using NW.js version 0.49.1", you mean the file that's the basis for the "final steam zip", right? You did not update the rpg maker itself to another NW.js version?
  • And another one for @SeaPhoenix (Thanks for your expertise! xD) : In the first two screenshots of my first post, did I connect the achievements, their API-names and the plugin commands correctly? NekoGakuen is a bit confusing here because they always write about the IDs instead of the names. (But steam doesn't even show IDs anymore.)



And now it gets CRAZY.
Reading @utunnels post, I remembered something I read some time ago: The rpg maker might act up if a project is located in a dropbox – which mine is. It might even "corrupt" projects in some way.
So I tried creating a new project directly on my HDD, adding NekoGakuen and seeing if I can introduce the achievements of my steam game.
The result was somewhat wild, when testing the project in rpg maker itself as well as online through steam: The game crashes the test application a second after starting (and before showing any content), opens it up again a moment later, crashes it after a second, opens it up again ... AND SO ON, with no end in sight. At one point, it stopped for a couple of seconds, but then continued.
Closing the rpg maker did nothing. Trying to open the dev tools in order to see what the is happening didn't work. The task manager was useless because it happened too quickly. In the end I had to restart my pc because a friend was complaining about his steam notifications (of me restarting my game xD) going haywire ...
So yeah, NO idea what's happening here. I just added NekoGakuen to an essentially empty project ...?



Thanks for engaging, everbody!!
To answer your questions, I'm using NW.js version 0.49.1 only after deployment (i.e., I copied the relevant folders/files from my deployed game to the unzipped NW.js folder). It does look as though you're calling the achievement correctly in the plugin command - the achievement id is the one in Steam.

From the error messages, the plugin can't find the greenworks.js file, though I can see it in your screenshot. So I would just double-check to make sure you see it too in the folder where you're testing the game.

Since you mentioned that you're using Steamworks SDK 1.6.0, did you change that to 1.5.0 when you used my setup? In the website where you download the greenworks prebuild, I don't see an option for 1.6.0 (you can view the options in the Release Tag on the left in the screenshot below), which is why I stuck to Steamworks SDK 1.5.0 so that I could use v083 of the greenworks prebuild and get the NW.js version closest to MZ's default.

1723329450715.png


Finally, as someone else suggested above, I would recommend not putting any of your game projects (the ones you're working on) in a cloud-synced folder like Dropbox or OneDrive, as that has a probability of corrupting your files.
@LaCipolla I guess the plugin you have are trying to open the actual game on steam...(which is a good thing! It means greenworks in loaded.) maybe you can try changing the parameter? The plugin you are using tried to wrap everything in its own functions which also make it hard to read through thousands of lines.
Maybe you can try SeaPhoenix's or just copy sample code from greenworks site, achievement getting is only a few lines of code.

This is my lazy code used in my game. Just save them as plugin and call ActiveAchievement('name')
By the way I'm using nw.js 0.86, but I guess nothing big has been changed.
Spoiler: code
JavaScript:
var greenworks = null;
try{
  greenworks = require('./greenworks'); //path to your greenworks.js
  greenworks.init();
}catch(ex){
  console.log(ex);
  greenworks = null;
};

function ActiveAchievement(achievement, success_callback, error_callback){
  try{
    success_callback = success_callback||function(){};
    error_callback = error_callback||function(){};
    greenworks.activateAchievement(achievement, success_callback, error_callback);
  }catch(ex){
    console.log('failed to active achievement: ', achievement);
    console.log(ex);
  }
}
I recently added Steam Achievements to my game. It was a lot of work to figure out. I didn't use NekoGakuen though
Since you mentioned that you're using Steamworks SDK 1.6.0, did you change that to 1.5.0 when you used my setup? In the website where you download the greenworks prebuild, I don't see an option for 1.6.0 (you can view the options in the Release Tag on the left in the screenshot below), which is why I stuck to Steamworks SDK 1.5.0 so that I could use v083 of the greenworks prebuild and get the NW.js version closest to MZ's default.

Gentlepeople of the internet ... WE'VE GOT IT! 😀

Nek23.jpg

This was the problem. I don't know what was the problem LAST time (because sdk 1.6 wasn't out back then), but it seems in the end it was just the combination of things after all. "Couldn't be the sdk right ...?" yeah sure 🙄

But instead of going too crazy over it, I will now be happy with having ACHIEVEMENTS IN MY GAME!! 😮😳😀

THANKS A BUNCH AGAIN!



And I think I might write a little "guide for the guide" for NekoGakuen so that not every MZ user has to crawl the forums for troubleshooting.

o/
Hi! I'm searching around to see if there is any way to activate Steam achievements. Thanks for engaging in our discussion these days 🙂I'd like to try the method you put here, but I still don't know much about the API stuff so I guess I need some help.😩
Could you tell me more about how to configure it? Like, where should I put greenworks.js, the node file that is downloaded along with it, the plugin with your code, and what files else I need to prepare? Thanks!
This is my lazy code used in my game. Just save them as plugin and call ActiveAchievement('name')
By the way I'm using nw.js 0.86, but I guess nothing big has been changed.
Edit: I prepared a lib folder and greenworks.js in the project folder (where my game.rmmzproject lies) according to Hudell's Orange Greenworks configure guide. Then I copied your code, edited the path of greenworks.js (to ../../greenworks) and made it a plugin. Later I set up a test Event Command to call greenworks.activateAchievement with the code I copied from greenworks' sample file and edited the achievement name. When test playing via Steam, it shows "TypeError: Cannot read properties of null (reading 'activateAchievement')" Did I miss something?

Edit 2.0: Just figure it out! Here's how I fixed it and made it work.
Hi! I'm searching around to see if there is any way to activate Steam achievements. Thanks for engaging in our discussion these days 🙂I'd like to try the method you put here, but I still don't know much about the API stuff so I guess I need some help.😩
Could you tell me more about how to configure it? Like, where should I put greenworks.js, the node file that is downloaded along with it, the plugin with your code, and what files else I need to prepare? Thanks!
You can check greenworks document it explains that quite well. On windows it should be like this:
Code:
|-- greenworks.js
|-- index.html
|-- lib
|   |-- greenworks node file
|   |-- steam api dll file
|   `-- other steam sdk dll file
|-- package.json
`-- steam_appid.txt
Oooh thanks! I'll check it later!👋
Hi, I just tried it out. There's no TypeError when I call the activate command, but the achievement is still locked.😔 And somehow I still cannot open dev tools so I need some time to figure it out...

@LaCipolla Hi! I wanna know if your store page is published when you're doing these tests with Steam Playtest. There were many moments when I felt I got everything right (no errors popped out) but the achievement just wouldn't be activated. I'm not sure if the store page thing can be something to cause this.😢

Edited: It doesn't matter if your store page is published or not. Achievements for your playtest version can be activated, only requires you to publish your playtest on Steam!
Yes, I had a published store page even before I tried out achievements, so I can't tell you if that's relevant.

Original thread: https://forums.rpgmakerweb.com/threads/cant-get-steam-achievements-to-work-in-rmmz.170981/