Achievement Object
Last updated
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
The AchievementObject is generated by importing achievements from the Steam Developer Portal. You do this by selecting your Steam Settings object and expanding the Achievements section and clicking the Import button.
The AchievementObject scriptable object simply exposes the structure to Unity's ScriptableObject. This allows you to create references in your scripts such that you can drag and drop the achievement and allows us to manage a UnityEvent that will raise when the achievement is locked or unlocked.
You do not have to use the ScriptableObject you can simply use the structure if you are more comfortable with them.
This is raised when the achievement is cleared, set or reset through Heathen's tools and systems. It cannot detect when the achievement is modified outside of Heathen's systems.
The handler for this event would like the following
Returns the ID of the achievement, note in the editor you can both read and write this value however in a build you can only read this value. The write operation is only used when importing achievments from Steam whcih can only happen at development time in the editor.
Returns the display name of the achievement, as with ID, in builds this can only be read, in the editor however it can be read and writen to in order to support the import of achievements at development time.
Returns the description of the achievement, as with ID, in builds this can only be read, in the editor however it can be read and written to in order to support the import of achievements at development time.
Returns the hidden flag for this achievement, as with ID, in builds this can only be read, in the editor however it can be read and written to in order to support the import of achievements at development time.
This can be read to determine if the user has unlocked this achievement, this can be written to in order to unlock this achievement.
Note that if the achievement is set to write trusted only then the attempt to write to this achievement will simply do nothing.
A nullable datetime expression indicating the date and time the achievement was achieved if any
Unlocks the achievement for the local user or if on a game server pass in the user ID to unlock the achievement for a specific user.
The server version (takes the user paramiter) will only work from Steam Game Servers and only when the indicated user has been authenticated.
When in a client build this is the same as
Clears the achievement state for the local user in client builds (do not pass the user parameter). For server builds you would pass in the user parameter to clear the achievement for the indicated user. The server version (takes the user parameter) will only work from Steam Game Servers and only when the indicated user has been authenticated.
Returns the unlock status and unlock time if relevant for the achievement.
Gets the current icon for the achievement. This is sinsative to the user's unlock/lock status. So if the user has achieved this achievement this will be the "unlock" icon, if not it will be the "locked" icon.
This simply calls StatsAndAchievements.Client.StoreStats()
and is only used on client builds to store any updated stats and achievements to the backend.
You should not call this every time you update the value of a stat or achievement. The intended purpose from Valve is that you can update your stats and achievements in real time during gameplay and then at key points such as at the end of a mission or similar store those stats to the backend.
The notification of a stat or achievement being updated only happens when you call store stats or when the game closes.
The Store Stats function is rate limited so if you call it to frequiently the Steam API will ignore you.
Gets the achievement state for this achievement for the indicated user. This is only available from Steam Game Servers and only when the indicated user has been authenticated and its states requested. See the interface for details