Madder Stat
Base class for Madder player stats that are shown per game on the player’s account
Overview
The Madder Stat class is the base class for Madder player stats. These stats are shown per game on the player’s account. The Madder Stat class is a generic serializable class that can be used to store the following types of stats:
- String
- Int
- Float
- Bool
The Name
is the name of the stat and is REQUIRED. The Value
is the value of the stat and is REQUIRED. Using a
disallowed stat type will result in an exception.
Usage
Player stats are added to the player’s account through the Madder Messager’s
UpdateMadderPlayerStats
method. This function takes a Madder Player object serialized as a JSON
string. The Madder Player object contains a dictionary of stats that are updated on the player’s account. Because it is
a dictionary, you can add as many stats as you like to the player’s account.
The Madder Stat class may be extended to add calculations and functions. For example, you may want to track a total number of kills a player has accumulated in your game, but you only want to display their K/D ratio:
There is no limit to the number of stats you can add to a player’s account. However, it is recommended to keep the number of stats to a reasonable amount to avoid performance issues and to keep the player’s account clean.
Was this page helpful?