Skip to content

FSAL_StatWrite

Datatype preview

Blueprint struct describing a single stat write operation for Steam. Used by Set Local (Cached) Stat and Set Local (Cached) Stats (Batch).

Fields

Field Type Description
APIStatName String Stat API name exactly as defined in Steamworks (e.g., TOTAL_JUMPS).
StatType Enum (Integer / Float / Average) Write mode. Average uses CountThisSession & SessionLengthSeconds.
IntegerValue int32 Used when StatType = Integer. The new integer value to set.
FloatValue float Used when StatType = Float. The new float value to set.
CountThisSession float Used when StatType = Average. Amount counted in this measurement window (e.g., events).
SessionLengthSeconds float Used when StatType = Average. Duration for the measurement window in seconds (must be > 0).

Notes

  • This struct feeds Set Local (Cached) Stat (single) and Set Local (Cached) Stats (Batch) (multiple).
  • For Average stats, Steam computes a rate via UpdateAvgRateStat(CountThisSession, SessionLengthSeconds); the stored value is a float.
  • Writes affect the local cache only—persist to Steam with Store User Stats & Achievements.
  • APIStatName must match your Steamworks schema exactly.

Typical usage

  • End-of-level batch: build an array of FSAL_StatWrite (mix Integer/Float/Average) → call Set Local (Cached) Stats (Batch)Store User Stats & Achievements.
  • Average rate example: record CountThisSession = 120 over SessionLengthSeconds = 60 → results in a rate of 2.0 per second.