Stats
Talo stats let you track player data and aggregated global data like how many items have been crafted or how many deaths a player has.
To create a stat, head over to the dashboard, visit the stats page and create your first stat. Take note of the internalName
as this is how you'll be referring to your stat.
Difference between stats and events
Stats allow you to have far more control over quantitative data using the limits you can set in the dashboard.
Tracking stats
You can track a stat using the Stats API Track()
function which takes your stat's internalName
and the amount to change the stat by (default 1.0f):
PlayerDeathController.cs
public void OnDeath()
{
Talo.Stats.Track('death')
}
PlayerPotionController.cs
private float health;
public void OnHeal(Potion potion)
{
health += potion.amount
Talo.Stats.Track('health-healed', potion.amount)
}