LuaStats.wiki
changeset 1922 0e978d0457b1
parent 1885 0a53771f4619
child 1923 6755e22daa77
equal deleted inserted replaced
1921:e65b834f2dd9 1922:0e978d0457b1
    16 
    16 
    17 || *`TStatInfoType`* || *Meaning of `statMessage`* || *Team parameter used?* ||
    17 || *`TStatInfoType`* || *Meaning of `statMessage`* || *Team parameter used?* ||
    18 || `siGraphTitle` || Title of the graph. If you use this, the health icon changes into a star. || No ||
    18 || `siGraphTitle` || Title of the graph. If you use this, the health icon changes into a star. || No ||
    19 || `siGameResult` || Title of the stats screen, used to show the result of the game, i.e. who won the game || No ||
    19 || `siGameResult` || Title of the stats screen, used to show the result of the game, i.e. who won the game || No ||
    20 || `siCustomAchievement` || A freeform text for a single “bullet point” in the “bullet point” list in the details section. For each time you call `SendStat` with this `TStatInfoType`, a new “bullet point” gets added to the list. || No ||
    20 || `siCustomAchievement` || A freeform text for a single “bullet point” in the “bullet point” list in the details section. For each time you call `SendStat` with this `TStatInfoType`, a new “bullet point” gets added to the list. || No ||
    21 || `siPointType` || Replaces the word “kills” in the ranking list. You have to call this each time before you report the score or kills of a team with `siPlayerKills`. Sadly, grammatical number is currently not respected at all here. || No ||
    21 || `siPointType` || Replaces the word “kills” in the ranking list. You have to call this each time before you report the score or kills of a team with `siPlayerKills`. Since version 1.0.0, there are a few special values you can use (see below).
    22 || `siPlayerKills` || Adds a team into the ranking with the given number of kills. The order in which this is called for each team matters. Unless the word “kills” has been replaced by `siPointType`, then that word is used instead. Only integers (converted to string) are possible. || Yes ||
    22 || No ||
       
    23 || `siPlayerKills` || Adds a team into the ranking with the given number of kills. The order in which this is called for each team matters. Unless the word “kills” has been replaced by `siPointType`, then that word is used instead. Only integers (converted to string) are possible. 
       
    24 
       
    25 || Yes ||
    23 || `siClanHealth` || Value of a data point. This sets a single data point on the graph for the specified team. All teams will be converted to clans prior to drawing, there can only be one chart per clan. Subsequent calls will draw the next point along the horizontal axis; the frontend will then simply connect the dots in the final chart. Only whole numbers are supported. There must be at least 2 data points for any given clan, otherwise there won't be much to look at. ;-) You also should have called `SendHealthStatsOff` if to prevent the default health graphs to be drawn. || Yes ||
    26 || `siClanHealth` || Value of a data point. This sets a single data point on the graph for the specified team. All teams will be converted to clans prior to drawing, there can only be one chart per clan. Subsequent calls will draw the next point along the horizontal axis; the frontend will then simply connect the dots in the final chart. Only whole numbers are supported. There must be at least 2 data points for any given clan, otherwise there won't be much to look at. ;-) You also should have called `SendHealthStatsOff` if to prevent the default health graphs to be drawn. || Yes ||
    24 || `siMaxStepKills` || Most hedgehogs killed in a round. `statMessage` must be in format “`<kills> <name of killer hedgehog> (<team name of killer>)`”. || No ||
    27 || `siMaxStepKills` || Most hedgehogs killed in a round. `statMessage` must be in format “`<kills> <name of killer hedgehog> (<team name of killer>)`”. || No ||
    25 || `siMaxTeamDamage` || Team with most damage inflicted to self. `statMessage` must be in the format “`<damage> <team name>`”. || No ||
    28 || `siMaxTeamDamage` || Team with most damage inflicted to self. `statMessage` must be in the format “`<damage> <team name>`”. || No ||
    26 || `siKilledHHs` || Total number of killed hedgehogs (converted to string). || No ||
    29 || `siKilledHHs` || Total number of killed hedgehogs (converted to string). || No ||
    27 || `siTeamStats` || This does not have an effect. || No ||
    30 || `siTeamStats` || This does not have an effect. || No ||
    28 || `siMaxStepDamage` || Most damage in one turn for the “best shot award”. `statMessage` must be in format “`<damage> <hedgehog name> (<team name>)`”. || No ||
    31 || `siMaxStepDamage` || Most damage in one turn for the “best shot award”. `statMessage` must be in format “`<damage> <hedgehog name> (<team name>)`”. || No ||
    29 || `siMaxTurnSkips` || Team with most skips. `statMessage` must be of format “`<number> <teamName>`”. || No ||
    32 || `siMaxTurnSkips` || Team with most skips. `statMessage` must be of format “`<number> <teamName>`”. || No ||
    30 || `siTeamRank` || Overwrite rank of team. `statMessage` is the rank of your choice. Must be sent before `siPlayerKills` of the team in question. || No ||
    33 || `siTeamRank` || Overwrite rank of team. `statMessage` is the rank of your choice. Must be sent before `siPlayerKills` of the team in question. || No ||
    31 
    34 
    32 <b>Examples:</b>
    35 === Special values for `siPointType` (1.0.0) ===
       
    36 
       
    37 For `siPointType`, we support a few common point types. Just set `statMessage` to one of the following special values below:
       
    38 
       
    39 || Value of `statMessage` || Meaning || Example ||
       
    40 || `"!POINTS"` || Number of points || (25 points) ||
       
    41 || `"!CRATES"` || Number of crates || (25 crates) ||
       
    42 || `"!TIME"` || Number of millisecons || (0.025 seconds) ||
       
    43 || `"!EMPTY"` || Don't display anything besides the team name || ||
       
    44 
       
    45 The special values will get properly localized in the frontend with proper numerus (e.g. singluar/plural) support.
       
    46 
       
    47 If you use any other value, Hedgewars will use this string literally, but there's no proper numerus support then, which might screw up translation. Use the special values whenever possible.
       
    48 
       
    49 If you want to use the number of kills in the ranking list, you do not need to call `SendStat`. The number of kills is already the default.
       
    50 
       
    51 === Examples ===
    33 
    52 
    34 <code language="lua">
    53 <code language="lua">
    35 -- will automatically change the health icon to a star
    54 -- will automatically change the health icon to a star
    36 SendStat(siGraphTitle,'Custom Graph Title')
    55 SendStat(siGraphTitle,'Custom Graph Title')
    37 
    56 
    42 -- Adds 3 teams into the ranking: First, Team A (with 3 kills), then Team B (1 kill) and then Team C (5 kills).
    61 -- Adds 3 teams into the ranking: First, Team A (with 3 kills), then Team B (1 kill) and then Team C (5 kills).
    43 SendStat(siPlayerKills, "3", 'Team A')
    62 SendStat(siPlayerKills, "3", 'Team A')
    44 SendStat(siPlayerKills, "1", 'Team B')
    63 SendStat(siPlayerKills, "1", 'Team B')
    45 SendStat(siPlayerKills, "5", 'Team C')
    64 SendStat(siPlayerKills, "5", 'Team C')
    46 
    65 
    47 -- In the next ranking, this changes the word “kills” to “points”,
    66 -- In the next ranking, this changes the word “kill”/“kills” to ”point”/“points”
    48 -- call it just before sending kills/score for each team
    67 SendStat(siPointType, "!POINTS")
    49 -- in case you want to change the word i.e. print “point” or “points”
       
    50 SendStat(siPointType, "points")
       
    51 
    68 
    52 -- this will add Team D to the ranking and show “3 points“ in brackets (because of the siPointType above)
    69 -- this will add Team D to the ranking and show “3 points“ in brackets (because of the siPointType above)
    53 SendStat(siPlayerKills, "3", "Team D")
    70 SendStat(siPlayerKills, "3", "Team D")
    54 
    71 
    55 -- call siClanHealth to send the "value" of a clan that will be used for the graph creation
    72 -- call siClanHealth to send the "value" of a clan that will be used for the graph creation