cyanic's Steam Achievements Integration

It's in one of the engine scripts. Maybe look at the one for graphics? I'll check later when I have a moment.
Cool, hopefully you could figure something out.
OK, I removed your script but the game is still lagging when I test play it in Steam. I think the problem might be Steam itself after all and not your script... only the Steam build lags like this, since the out-of-Steam version works normally 😳
In the "Scene_Base" script, find the method "update_basic", and add a call to "SteamUserStatsLite.instance.update" somewhere (at the beginning or end of the method is fine), and see if it helps.
I'll be trying that!
I've got another report from someone, and they also say it doesn't seem to matter whether the script is present. Could you tell me the processor, OS, and graphics card of the computer you're testing your game on?
Intel Core i5-3350P CPU 3.10 Ghz
Windows 10
Nvidia Geforce GTX 660
Intel Core i5-3350P CPU 3.10 Ghz
Windows 10
Nvidia Geforce GTX 660

Sorry for asking this after almost a month, but Labyr...are you using the "Language File System" script, by any chance? Or which others scripts are you using? Maybe we can find the one messing with the performance...Thanks!
It turned out that the video script he was using caused problems with the Steam Overlay. The overlay times out a while after the video plays and starts spamming log writes to disk, which severely degrades performance.
It turned out that the video script he was using caused problems with the Steam Overlay. The overlay times out a while after the video plays and starts spamming log writes to disk, which severely degrades performance.

Do you remember which video script was he using? I think I'm on the same boat XD Thanks!
Zeus Video Player IIRC

FWIW, you can probably ask Valve to disable the overlay and continue using your video script. The overlay doesn't work properly on VX Ace anyway.
Really? Thanks! I'll try that, I think I can disable the overlay for the game on the steamwork platform...however I want to test if it's working for me without that script before contacting Valve. XD
The script has been updated with different versions for different Steamworks SDK versions that you might want to use.
Thank you for this 😀
Thank you for this! I had an old project I wanted to release as a free game and I didn't want to deal with steam achievements and stuff. This script is great and has been stickied! I can't believe I missed this before.
Is there a way to check if an achievement has been acquired as a conditional branch?
Well, the script - R7 version - does have a method to retrieve any given achievement. (I suspect you should pass the achievement name as a "String" to make it work.)
The problem is that it can fool you if you have NEVER implemented that achievement because it will just return a nil value (Ruby's equivalent of Nothing but can also be treated as a falsy value - a boolean). That's why I felt in need to come up with this patch for R7.

Ruby:
# * Steam User Stats Lite R7 * #
# - Achievement Query Patch  - #
#   Scripter : Kyonides Arkanthes
#   2023-08-19

# SteamUserStatsLite.instance.has_achievement?("Has Achievement")

class SteamUserStatsLite
  RAISE_ERROR = true # << Value should be true or false only
  def has_achievement?(name)
    result = get_achievement(name)
    if result.nil?
      if RAISE_ERROR
        raise(SteamNoAchievementError, name)
      else
        msgbox name + " has not been implemented!"
      end
    else
      result
    end
  end
end

class SteamNoAchievementError < StandardError
  def initialize(name)
    @achievement_name = name
  end

  def to_s
    "'#{@achievement_name}' has not been implemented!"
  end
end

Script Calls

Ruby:
steam = SteamUserStatsLite.instance
steam.has_achievement?("Achievement")

Or a short version of it...

Ruby:
SteamUserStatsLite.instance.has_achievement?("Achievement")

If the achievement has never existed, it will raise an error to warn you about it. Then it will crash the game. XD But hey! It has to! It's something that you should fix no matter what.
Thank you!
Well, the script - R7 version - does have a method to retrieve any given achievement. (I suspect you should pass the achievement name as a "String" to make it work.)
The problem is that it can fool you if you have NEVER implemented that achievement because it will just return a nil value (Ruby's equivalent of Nothing but can also be treated as a falsy value - a boolean). That's why I felt in need to come up with this patch for R7.

Ruby:
# * Steam User Stats Lite R7 * #
# - Achievement Query Patch  - #
#   Scripter : Kyonides Arkanthes
#   2023-08-19

class SteamUserStatsLite
  def has_achievement?(name)
    result = get_achievement(name)
    if result.nil?
      raise(SteamNoAchievementError, name)
    else
      result
    end
  end
end

class SteamNoAchievementError < StandardError
  def initialize(name)
    @achievement_name = name
  end

  def to_s
    "'#{@achievement_name}' has not been implemented!"
  end
end

Script Calls

Ruby:
steam = SteamUserStatsLite.instance
steam.has_achievement?("Achievement")

Or a short version of it...

Ruby:
SteamUserStatsLite.instance.has_achievement?("Achievement")

If the achievement has never existed, it will raise an error to warn you about it. Then it will crash the game. XD But hey! It has to! It's something that you should fix no matter what.
So add this to the script or make it a snippet below it, (i.e. the code part)?


In the "Scene_Base" script, find the method "update_basic", and add a call to "SteamUserStatsLite.instance.update" somewhere (at the beginning or end of the method is fine), and see if it helps.
Can someone show me a screenshot of this
I am getting a syntax error on Line 32 of the r7 script. It says "unexpected tIDENTIFER, expecting $end $imported ['cyanic-SteamUsterStatsLite'] = 7

Am I missing another script, perhaps?

My error, incorrectly copied/pasted the script from GitHub.

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