steamworks.setAchievementProgress()

Type Function
Return value Boolean
Revision Release 2024.3703
Keywords steam, steamworks, achievements, setAchievementProgress
See also steamworks.setAchievementUnlocked()
achievementInfoUpdate
steamworks.*

Overview

Sets the amount of progress made towards one achievement for the current user. This is mostly intended for display purposes. Calling this function will trigger a Steam notification popup to be displayed to the user, indicating their current progress, but only if overlays are enabled by the user in the Steam client. If the given progress value argument is greater than or equal to the given maxValue argument, the achievement will be automatically unlocked.

Returns true if achievement progression was successfully updated.

Returns false if given invalid arguments or if the steamworks.isLoggedOn property is false.

Note

You can control where Steam’s notification popup will appear within the app by using the steamworks.setNotificationPosition() function.

Gotchas

Steam does not save the amount of progress made towards an achievement. Steam only saves an achievement’s lock/unlock status. This means that it’s up to the application developer to track and store this amount outside of Steam, such as to file, until it has been unlocked.

Syntax

steamworks.setAchievementProgress( achievementName, value, maxValue )
achievementName (required)

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

value (required)

Number. Integer indicating the current progress made towards the achievement, ranging between 0 and the maxValue argument.

maxValue (required)

Number. Integer defining the maximum progression value until the achievement will be unlocked.

Example

local steamworks = require( "plugin.steamworks" )

-- Set the achievement progress to "50/100"
steamworks.setAchievementProgress( "My Achievement Name", 50, 100 )