cyanic's Steam Achievements Integration

Thanks. I sent him a message and will keep investigating to see if I can get this through 🙂
Try the version on the pointers-fix branch: link. I tested it on Windows 10, but nowhere else, so there may still be some problems.


Bug explanation: In the version of Ruby used in VX Ace, pointers are treated as strings. It appears that Ruby copied the return value literally as a string, so the end result is a truncated vtable at the first NULL character. Changing some return values to number should have Ruby retain the original pointer value.



Just gonna come in here and say this fixed it, and I'm on Win 7 🙂  (it too, suddenly broke for me about the time that someone else posted on here saying it broke!)
You don't need to upload a build, but you do need to make sure the stats are configured properly, then published. If you need some live help, try chatting up Miller, since he's got it all integrated and should know how to get everything working on Steam's end (I don't have my own game, so no access to the partner panel to look things up).



Hey cyanic! I was able to get it working. The problem was that I had to do  "steam.request_current_stats" before using the "get_stat_int" or the "get_num_achievements". Thanks 🙂
The script has been updated for Steamworks SDK 1.37. If you are not planning on updating your steam_api.dll, you don't want to update to this version.
The script has been updated for Steamworks SDK 1.37. If you are not planning on updating your steam_api.dll, you don't want to update to this version.



Perfect cyanic! Thank you very much... I was checking this today to see if there was any update...


Also, I wanted to ask you something...do you have the Steamworks SDK 1.37 complete? Could you download it? I'm trying since last week but the file doesn't download complete 🙁  Could you upload it? (I know this doesn't have anything to do with the script, so it's okay if you don't want) 😀  
I have the latest SDK downloaded, but I can't redistribute it because of the license agreement. Usually if you try a few times or wait to the next day, the download should work again. Not sure why it wouldn't download all the way, though. Maybe try another browser?
I have the latest SDK downloaded, but I can't redistribute it because of the license agreement. Usually if you try a few times or wait to the next day, the download should work again. Not sure why it wouldn't download all the way, though. Maybe try another browser?



Okay, I understand. I'm a Steam Developer as well but for some reason the download link is not complete when I try from my profile (I'm using the spanish steamwork page, maybe that's the reason). Anyways, thank you! I'll try to download it from another browser or computer. 🙂  
Hello Cyanic, sorry for double posting. I have a weird problem with the script now, and I'm going crazy with it. XD 
I noticed that, when I'm playing the game for a while, I leave it idle or when I change focus and use my computer while the game is running -after a while- it lags alot! It's running at 60 fps, it's normal, and then suddently falls to 4-7 fps and I have to press ALT+ENTER to go fullscreen (or window, depends) and then it's fixed...


There's no specific action that triggers this, it happens random.


I tried removing the script and it fixes it. It's weird because it seems like a problem with a paralel event of memory, but everything works fine without the achievements script. Maybe something to do with the new Steam SDK? (I did not update the script or the SDK)


Thank you for any help!
I've added a new version with function for setting achievement progress here. I haven't tested it yet as I don't have an RPG Maker project handy to do so, but if you're feeling adventurous or is in need of the feature, take it for a spin.
I noticed that, when I'm playing the game for a while, I leave it idle or when I change focus and use my computer while the game is running -after a while- it lags alot! It's running at 60 fps, it's normal, and then suddently falls to 4-7 fps and I have to press ALT+ENTER to go fullscreen (or window, depends) and then it's fixed...

Hmm... Does it happen if you don't call any of the methods in the script? Just keep a reference to SteamUserStatsLite.instance somewhere, but don't call anything within it. That way it could be narrowed down to whether it's the script itself, or an issue when you're calling the script (like maybe doing it too often).
Hi cyanic! It's been a while...XD sorry for bother you with this, but the script is not longer working with the latest Steamwork (1.41)...I don't know what happened...no error, no message, nothing, the achievement just doesn't pop...are you still supporting this? 😀

Thanks in advance!
Do you test-play your game through the editor? If so, try to run it normally.

Should that not work try download an earlier SDK and see if that fixes it for you.
Hi, sorry for the super late response (I think the thread reply notifications might have gone into spam). I just tried the latest SDK version, and it's working fine.

Also did a bit of tidying up on the OP, so links should no longer be broken. I added a note that if you have steam_appid.txt in your project folder and you launch RPG Maker using the project file, the current app ID will be set to your own and you can test achievements when launching with playtesting from RPG Maker.
Hello Cyanic, sorry for double posting. I have a weird problem with the script now, and I'm going crazy with it. XD
I noticed that, when I'm playing the game for a while, I leave it idle or when I change focus and use my computer while the game is running -after a while- it lags alot! It's running at 60 fps, it's normal, and then suddently falls to 4-7 fps and I have to press ALT+ENTER to go fullscreen (or window, depends) and then it's fixed...


There's no specific action that triggers this, it happens random.


I tried removing the script and it fixes it. It's weird because it seems like a problem with a paralel event of memory, but everything works fine without the achievements script. Maybe something to do with the new Steam SDK? (I did not update the script or the SDK)


Thank you for any help!

I have the same problem. At completely random times, the game suddenly starts lagging very badly. The framerate drops somewhere between 4-7 FPS just like Cloud_FFVII mentioned.
Is there any solution to this?
Do you have an example project I can look at?
I have only tried it in the game I have in Steam, obviously since that's where the achievements function. It has not yet been released, though.

I can also confirm the only way to stop the lag is either end the game completely or switching to alt-enter fullscreen and back. I suppose the lag doesn't appear at all if the player uses the alt-enter fullscreen at all times. So, the problem would be limited to windowed-mode gameplay.

At times, I could play an hour or two with no problems, but at some point the lag appears nevertheless.
If you could possibly cut it down to maybe just one map that this happens on and you can consistently reproduce, it would be very helpful. You can send me a conversation if you want.
I added some stuff in my previous post ^
I wonder if it has anything to do with callbacks. My example only shows running callbacks when you're doing something with achievements. Maybe if you add a call to "SteamUserStatsLite.instance.update" somewhere in the game update loop it might help (you'll have to dig through the engine code, I don't have a VX Ace project handy right now).
Uhh, not sure how to do that... I really don't know much of anything about scripting. Got any idea where this game update loop would be located?

Original thread: https://forums.rpgmakerweb.com/threads/cyanics-steam-achievements-integration.50640/