StatsAndAchievements.Client

Like what your seeing?

Consider supporting us as a GitHub Sponsor and get instant access to all our Unity assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!

Introduction

using StatsClient = HeathenEngineering.SteamworksIntegration.API.StatsAndAchievements.Client;
public static class StatsAndAchievements.Client
All features available to 1 are present in the other with some minor exceptions. The only notable difference is that Server related calls required you to provide the CSteamID of the user to be adjusted and will only work when that user is authenticated to the Steam Game Server that calls the method.

What can it do?

Set and reset Steam Stats and Achievements. Most of the features of the StatsAndAchievments interface can be accessed through its related objects.
Avg Rate Stat
Heathen KB
Float Stat
Heathen KB
Int Stat
Heathen KB
Achievement Object
Heathen KB

Events

User Stats Received

Called when the latest stats and achievements for a specific user (including the local user) have been received from the server.

User Stats Unloaded

Callback indicating that a user's stats have been unloaded.

User Stats Stored

Invoked when the user's stats are stored to Steam's backend

User Achievement Stored

Invoked when the user's achievements are stored to Steam's backend

How To

Clear Achievements and Stats

You can clear achievements either by using the interface
API.StatsAndAchievements.Client.ClearAChievement(name);
or by using the Achievement Object directly
Resetting a stat is as simple as setting its value, see the Int Stat and Float Stat object for details
You can optionally reset all stats and achievements
API.StatsAndAchievements.Client.ResetAllStats(bool andAchievements);

Set a Stat or Achievement

Its generally simplest to use the artifact object directly so the Achievement Object, Int Stat or Float Stat. You can also set them through the interface
API.StatsAndAchievments.Client.SetStat(value);
API.StatsAndAchievements.Client.SetAchievement(achievementName);