OrangeGreenworks - Steam Integration with Achievements and Time Log

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
Disregard this. Looks like my problem may have returned.

Also, I seem to be receiving invalid achievement name errors even with the quotes.

EDIT: In case it helps I'm using 64-bit NW.JS and here are the files as they are listed in my game install.
 

Attachments

  • 2021-04-12.png
    2021-04-12.png
    73 KB · Views: 22
  • 2021-04-12 (1).png
    2021-04-12 (1).png
    53.6 KB · Views: 23
Last edited:

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
After further analysis I have determined that my account is being read properly during playtesting so long as the app id file is present and I am testing from the Steam version. However, it doesn't seem to work properly when launched standalone. I'm at a loss - can someone advise?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,607
Reaction score
3,883
First Language
Java's Crypt
Primarily Uses
RMMZ
Did you create the steam_appid.txt file?
 

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
As I said, the app ID file is present. It's when I deploy to Steam that I start having problems. I even have a debug menu set up to cross-check my Steam information, but on deployment it shows Play Test as the user (as if I didn't do anything right). I have also confirmed that the files are all present in their places.

At any rate, I've cycled one of my achievements by removing and re-adding it. I'm not sure if that'll make much difference but I'm willing to give anything a try.

EDIT: I probably should've included a snapshot of my debug menu implementation. In case it helps I also have an issue where adding the integration code in Steamworks launch options makes the game completely unplayable (in that it soft locks at boot, displaying only an empty rectangle and nothing else although the game still continues to run).
 

Attachments

  • 2021-04-19.png
    2021-04-19.png
    107.8 KB · Views: 8
Last edited:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,607
Reaction score
3,883
First Language
Java's Crypt
Primarily Uses
RMMZ
Ah, sorry, I interpreted your last comment wrong. I'm assuming Steam was opened when you launched the standalone game. If it's open and there's nothing on the console, then I don't know what could be causing problems.
 

OneManIndie

THE One-Man Indie!
Veteran
Joined
Sep 22, 2013
Messages
353
Reaction score
210
First Language
English
Primarily Uses
RMXP
Question: Do I use
Code:
OrangeGreenworks.activateGameOverlay();
to get the Steam overlay to come up?
 

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
I think so, but I think it also depends on using --in-process-gpu which I have not been able to get going (as it immediately soft locks my game during startup).

In the meantime I finally got the plugin working in my game. I'm not sure how, but after I rearranged some of my logic related to Steamworks (particularly the platform detection used to determine how to handle achievements) it started to work without question. (Also, I switched from using the MV control variable interface to setting them in a script eval block, which I had to do anyway for the game not to crash on me when deploying to other platforms and storefronts e.g. Xbox, GameJolt etc.)

EDIT: I lied yesterday - unlock verification is still not working properly for the achievements menu. I changed the code on the F9 debug in the deployed game so that I would be able to check for achievement verification without having to copy over the SDK version of NW.JS, and all 100 switches which correspond to my achievements return true... and that's even for the achievements that I haven't yet unlocked.
 
Last edited:

OneManIndie

THE One-Man Indie!
Veteran
Joined
Sep 22, 2013
Messages
353
Reaction score
210
First Language
English
Primarily Uses
RMXP
Hmm... It's a bit tricky, but let's look at it this way. Once we get this figured out, well have a much better way to integrate Steam for RPG Maker for others to use.
 

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
I finally figured it out: you need to add --disable-direct-composition in addition to --in-process-gpu, and then the game won't freeze. (Also, it turned out to be a more general issue with NW.JS.) You can also add it directly into your package.json by adding this under your js-flags (but before anything else e.g. your window settings):

JSON:
"chromium-args": "--in-process-gpu --disable-direct-composition",

That way the package.json looks something like this:

JSON:
{
  "name": "",
  "main": "www/index.html",
  "js-flags": "--expose-gc",
  "chromium-args": "--in-process-gpu --disable-direct-composition",
  "window": {
    "title": "",
    "toolbar": false,
    "fullscreen": true,
    "width": 1109,
    "height": 624,
    "icon": "www/icon/icon.png"
  }
}

After that just run the game and you have a functional overlay with no crashes.
 

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
One more thing I forgot to add. While the process of resolving matters with the plugin was still being worked out, the issue of displaying the achievement list came up. Since the plugin is only partially documented for this purpose I figured that I would explain how to accomplish this.

First of all, I found the code detection method to be completely useless (or at least from my observations), and you also need to have released your game (otherwise you will be redirected to your Steam profile). Then, wherever you want to open your achievements list just use the following script evaluation:

JavaScript:
OrangeGreenworks.activateGameOverlay('Achievements')

Once the required conditions for your game are met, your achievements page will open in the overlay.

As a side note, you can also use this script evaluation for other purposes defined by Steamworks by using the respective keyword for that particular page. The complete list of possible values for the script call are as follows:
  1. Achievements
  2. Friends
  3. Community
  4. Players
  5. Settings
  6. OfficialGameGroup
  7. Stats
All values are string type so don't forget to use quotes.
 

Hayden

Veteran
Veteran
Joined
Jan 14, 2018
Messages
179
Reaction score
30
First Language
English
Primarily Uses
RMMV
I got this all setup and then when I tried to play the game just to see if I'd set it up right, it just says unexpected token > in the console when I press F12.

Any idea what I'm doing wrong here?
 

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
I got this all setup and then when I tried to play the game just to see if I'd set it up right, it just says unexpected token > in the console when I press F12.

Any idea what I'm doing wrong here?
My guess is that you either forgot your steam_appid.txt which should be in the root of your game package, or you haven't deployed a test build yet. Otherwise I have no idea.
 

Songsmith

Veteran
Veteran
Joined
Jun 17, 2016
Messages
68
Reaction score
4
First Language
English
Primarily Uses
N/A
Another ask (it's been nearly half a year since the last one) for updating the MakerDevs instructions to set up achievements on a Mac build. When you have the chance of course.
 

IndoorMinotaur

Villager
Member
Joined
Oct 10, 2020
Messages
9
Reaction score
2
First Language
English
Primarily Uses
RMMV
My guess is that you either forgot your steam_appid.txt which should be in the root of your game package, or you haven't deployed a test build yet. Otherwise I have no idea.
Do you happen to have a version of the plugin on your end? I got the same error mentioned above, and when I opened up the plugin to see what was wrong, it's because the whole plugin is a weird html doc.

[EDIT] Yeah, it seems like @Hudell 's plugin link on MakerDevs redirects to an html doc instead. I found the plugin on Github and it's working fine. Unfotunately, that means it's been redirecting to the wrong script since at least June, when the other person commented. :kaoswt:
 
Last edited:

ShenTzu

Veteran
Veteran
Joined
Nov 11, 2021
Messages
49
Reaction score
20
First Language
English
Primarily Uses
RMMV
I'm trying to use the setStat function in the plugin based on the documentation here, but it doesn't seem to work. For example say in the Steam stat config, the API name for the stat is "name", I tried a bunch of variations of the code in the script input, such as:

greenworks.setStat(name, 1)
greenworks.setStat('name', 1)
greenworks.setStat("name", 1)
greenworks.setStat(name, 1);
greenworks.setStat('name', 1);
etc

None of these seem to affect the progress stat on the Steam Achievements page, but I'm not familiar with scripting so I might be missing something. I'm pretty sure I configured everything right, because the activateAchievement and clearAchievement functions grant/removes the achievement just fine. And while I'm asking, is there a way I can increase the stat by 1 instead of setting a specific value? Thanks in advance!

EDIT: Solved! Turns out I needed to change greenworks to OrangeGreenworks, and define the stat name with a variable first (i.e. name = "statname"). In case anyone else needs the script for increasing the stat by 1 instead of setting a specific value, here it is:

name = "statname"
value = OrangeGreenworks.getStatInt(name) + 1
OrangeGreenworks.setStat(name, value)
 
Last edited:

MelonMintGames

Villager
Member
Joined
Jul 10, 2020
Messages
21
Reaction score
4
First Language
English
Primarily Uses
RMMV
As it appears the set-up instructions for this plugin have all but disappeared off the web, I am going to link the instructions via the internet archive for anyone who plans to use this in the future.
 

masterlobo

Veteran
Veteran
Joined
Mar 14, 2012
Messages
310
Reaction score
454
First Language
English
Primarily Uses
RMMV
So achievements are working... however, the overlay is not. Only when I'm not playing in full-screen I actually see the Achievement pop-up.

I am launching the game directly from the .exe, not from Steam. Is this expected to be tested only by launching the executable through Steam?
 

masterlobo

Veteran
Veteran
Joined
Mar 14, 2012
Messages
310
Reaction score
454
First Language
English
Primarily Uses
RMMV
So achievements are working... however, the overlay is not. Only when I'm not playing in full-screen I actually see the Achievement pop-up.

I am launching the game directly from the .exe, not from Steam. Is this expected to be tested only by launching the executable through Steam?

Well, I answered myself by trying it out myself and...

Yes launching the game through Steam did enable the Overlay! :)
 

Latest Threads

Latest Posts

Latest Profile Posts

yo i made a post but it hasnt really gotten any answers so uhhhh
Finished switching to a new PC. Now I could potentially start working at projects or plugins again if I feel the motivation to do so.
If you don't read the news, you are uninformed. If you read the news, you are misinformed.
Custom slip rates and custom ailment durations for enemies really opens up the floodgates for status effect use. I can have Poison and Time Stop affect bosses without it breaking their balance! Finally, a healthy middle ground.

(Especially after I cooked up a thing that prevents you from re-applying deadly states more than once in specific occassions.)
Voice.gif
The Voice... They usually show up to talk to you about leaving your mark on the world, which is one of the major themes of my game... How will you be remembered by society.

Forum statistics

Threads
124,534
Messages
1,164,276
Members
163,366
Latest member
kurutami
Top