steam_set_stat_float

Set a floating point statistic.

Syntax:

GML Code Example

steam_set_stat_float(stat_name, value);


Argument Description
stat_name The name of the statistic to set (a string).
value The value (a 32bit float) to set the stat to.


Returns: N/A


Description

With this function you can set a specific statistic to a new, floating point, value. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel. Examples of when you could use this are for tracking how far your player has travelled, or what percentage of the game is complete.


Example:

GML Code Example

var dist_pc = (dist / dist_max) * 100;
 steam_set_stat_float("Travelled", dist_pc);
 

The above code calculates a percentage based on the distance travelled variable "dist" and the maximum distance you can travel "dist_max" and then sets the stat "Travelled" to the new value.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here