Type Function
Return value AchievementInfo
Revision Release 2024.3703
Keywords steam, steamworks, achievements, getAchievementInfo
See also steamworks.requestUserProgress()


Returns an AchievementInfo object. This provides information about one achievement such as its localized name, description, unlock status, etc. for the currently logged in user (or another user).

When fetching another user's achievement information, you must first call the steamworks.requestUserProgress() function with that user's ID and wait for a successful userProgressUpdate event.


This function will return nil in the following cases:


steamworks.getAchievementInfo( achievementName [, userSteamId] )
achievementName (required)

String. On the Steamworks website, this is the unique name of the achievement set under the API Name Progress Stat column.

userSteamId (optional)

String. The unique string ID of the user. The ID will default to the current user if this argument is not provided.


local steamworks = require( "plugin.steamworks" )

-- Called when achievement status or stat data has been updated/changed
-- This will be called for the currently logged in user, and other users too
local function onUserProgressUpdated( event )
    -- Determine who this progress update is for
    if ( event.userSteamId == steamworks.userSteamId ) then
        print( "Received progress info for current user." )
        print( "Received progress info for another user." )

    -- Print the user's current achievement info
    local achievementInfo = steamworks.getAchievementInfo( "MyAchievementName", event.userSteamId )
    if ( achievementInfo ) then
        print( "  Localized Name: " .. achievementInfo.localizedName )
        print( "  Localized Description: " .. achievementInfo.localizedDescription )
        print( "  Is Hidden: " .. tostring(achievementInfo.hidden) )
        print( "  Was Unlocked: " .. tostring(achievementInfo.unlocked) )
        if ( achievementInfo.unlocked ) then
            -- Note that "unlockTime" is in local Unix time
            -- This can be compared with "os.time()" and used by ""
            print( "  Unlock Time: " .. "%c", achievementInfo.unlockTime ) )

-- Listen for achievement status or stat data changes from all users
steamworks.addEventListener( "userProgressUpdate", onUserProgressUpdated )