LuaStats.wiki
author Wuzzy
Mon, 16 Aug 2021 22:41:20 +0200
changeset 2218 eb6eef27205c
parent 2023 28eb488c6f8f
permissions -rw-r--r--
HWPlaySchemeSyntax: Remove "room=", it is not actually supported
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
     1
#summary List of stats functions in the Lua API
1842
f33a4823d9c9 LuaStats: Add label
Wuzzy
parents: 1764
diff changeset
     2
#labels !LuaFunctions
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
     3
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
     4
= Lua API: Stats functions =
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
     5
This page contains a list of all functions in the [LuaAPI Lua API] related to game stats. The game stats are used to display the end result when a game ends, this includes the game result title, team rankings, health graph and other comments.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
     6
1760
a9e06d2265f0 LuaStats: Add TOC
Wuzzy
parents: 1749
diff changeset
     7
<wiki:toc max_depth="2" />
a9e06d2265f0 LuaStats: Add TOC
Wuzzy
parents: 1749
diff changeset
     8
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
     9
== <tt>!SendStat(TStatInfoType, statMessage[, teamName])</tt> ==
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    10
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    11
This function allows to change the details of the stats screen seen after the end of a game.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    12
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    13
`TStatInfoType` is the piece of information you want to manipulate. The result of this functions varies greatly for different `TStatInfoType`s. The parameter `statMessage` is mandatory and is a string used for the statistics, its meaning depends on the `TStatInfoType`. The parameter `teamName` contains the name of a team which is relevant to the chosen stat. This parameter is not always required, this also depends on `TStatInfoType`.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    14
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    15
This tables explains the different behaviours of this function for different values of `TStatInfoType`:
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    16
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    17
|| *`TStatInfoType`* || *Meaning of `statMessage`* || *Team parameter used?* ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    18
|| `siGraphTitle` || Title of the graph. If you use this, the health icon changes into a star. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    19
|| `siGameResult` || Title of the stats screen, used to show the result of the game, i.e. who won the game || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    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 ||
2021
25a948f79196 LuaStats: remove 1.0.0 redundancy
Wuzzy
parents: 2020
diff changeset
    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`. There are a few special values you can use (see below). || No ||
1924
3d7e8679cea4 LuaStats: fix syntax (2)
Wuzzy
parents: 1923
diff changeset
    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 ||
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    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 ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    24
|| `siMaxStepKills` || Most hedgehogs killed in a round. `statMessage` must be in format “`<kills> <name of killer hedgehog> (<team name of killer>)`”. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    25
|| `siMaxTeamDamage` || Team with most damage inflicted to self. `statMessage` must be in the format “`<damage> <team name>`”. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    26
|| `siKilledHHs` || Total number of killed hedgehogs (converted to string). || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    27
|| `siTeamStats` || This does not have an effect. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    28
|| `siMaxStepDamage` || Most damage in one turn for the “best shot award”. `statMessage` must be in format “`<damage> <hedgehog name> (<team name>)`”. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    29
|| `siMaxTurnSkips` || Team with most skips. `statMessage` must be of format “`<number> <teamName>`”. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    30
|| `siTeamRank` || Overwrite rank of team. `statMessage` is the rank of your choice. Must be sent before `siPlayerKills` of the team in question. || No ||
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    31
2021
25a948f79196 LuaStats: remove 1.0.0 redundancy
Wuzzy
parents: 2020
diff changeset
    32
=== Values for `siPointType` ===
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    33
2020
823ccc573d62 LuaStats: Extend siPointType table
Wuzzy
parents: 1931
diff changeset
    34
For `siPointType`, we support a few common point types. Just set `statMessage` to one of the following values below:
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    35
1927
cc87110402f5 LuaStats: typos
Wuzzy
parents: 1926
diff changeset
    36
|| *Value of `statMessage`* || *Meaning* || *How it may appear in team rankings* ||
1926
6c537db77e65 LuaStats: Better example
Wuzzy
parents: 1925
diff changeset
    37
|| `"!POINTS"` || Number of points || Team 1 (25 points) ||
6c537db77e65 LuaStats: Better example
Wuzzy
parents: 1925
diff changeset
    38
|| `"!CRATES"` || Number of crates || Team 1 (25 crates) ||
1929
70af40ea30f8 LuaStats: Add !TIME0 to !TIME3
Wuzzy
parents: 1928
diff changeset
    39
|| `"!TIME"` || Number of milliseconds, shown as seconds with 3 decimal places || Team 1 (0.025 seconds) ||
1931
d6ef1025d96f LuaStats: fix syntax
Wuzzy
parents: 1930
diff changeset
    40
|| `"!TIME0"` … `"!TIME3"` || Number of milliseconds, shown as seconds with the decimal places specified in the number (e.g. `"!TIME2"` for 2 decimal places) || Team 1 (0.02 seconds) ||
1926
6c537db77e65 LuaStats: Better example
Wuzzy
parents: 1925
diff changeset
    41
|| `"!EMPTY"` || Don't display anything besides the team name || Team 1 ||
2020
823ccc573d62 LuaStats: Extend siPointType table
Wuzzy
parents: 1931
diff changeset
    42
|| _Anything else_ || Custom text with number. Display `statMessage` after the number || Team 1 (25 stars) ||
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    43
2022
654f68cfbeac LuaStats: Warnings for siPointType
Wuzzy
parents: 2021
diff changeset
    44
If `siPointType` was not used, the point type will default to “number of kills” and is displayed in the ranking like “Team 1 (2 kills)”.
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    45
2022
654f68cfbeac LuaStats: Warnings for siPointType
Wuzzy
parents: 2021
diff changeset
    46
The default point type and the special point types (those with the exclamation mark) will get localized in the frontend, including numerus form and decimal point. Do not enclose these special values in `loc()` (see [LuaLibraryLocale]).
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    47
2023
28eb488c6f8f LuaStats: Localize
Wuzzy
parents: 2022
diff changeset
    48
If you use the custom text with number, it will not be localized by the frontend, but it's supposed to be localized in Lua instead, just use `loc()`. However, this type doesn't support localization of the numerus form and decimal point, so only use this one as a last resort.
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    49
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    50
=== Examples ===
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    51
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    52
<code language="lua">
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    53
-- will automatically change the health icon to a star
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    54
SendStat(siGraphTitle,'Custom Graph Title')
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    55
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    56
SendStat(siGameResult,'Winner is Team A!')
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    57
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    58
SendStat(siCustomAchievement,'This is a custom message posted in the Details section!')
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    59
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    60
-- Adds 3 teams into the ranking: First, Team A (with 3 kills), then Team B (1 kill) and then Team C (5 kills).
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    61
SendStat(siPlayerKills, "3", 'Team A')
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    62
SendStat(siPlayerKills, "1", 'Team B')
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    63
SendStat(siPlayerKills, "5", 'Team C')
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    64
1922
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    65
-- In the next ranking, this changes the word “kill”/“kills” to ”point”/“points”
0e978d0457b1 LuaStats: siPointType special values
Wuzzy
parents: 1885
diff changeset
    66
SendStat(siPointType, "!POINTS")
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    67
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    68
-- this will add Team D to the ranking and show “3 points“ in brackets (because of the siPointType above)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    69
SendStat(siPlayerKills, "3", "Team D")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    70
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    71
-- call siClanHealth to send the "value" of a clan that will be used for the graph creation
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    72
-- a good idea is to call it always for every hog by using the runOnGears(function)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    73
-- in normal mode "value" represents clan health
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    74
SendStat(siClanHealth, "100", "teamName")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    75
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    76
-- most hedgehogs killed in a round (hedgehogName is who killed them)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    77
SendStat(siMaxStepKills, "1 hedgehogName (teamName)")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    78
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    79
-- team with most damage inflicted to self
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    80
SendStat(siMaxTeamDamage, "100 teamName")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    81
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    82
-- total number of killed hedgehogs
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    83
SendStat(siKilledHHs, "1")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    84
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    85
-- best shot award
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    86
SendStat(siMaxStepDamage, "30 hedgehogName (teamName)")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    87
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    88
-- team with most kills of own hedgehogs
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    89
SendStat(siMaxStepDamage, "2 teamName")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    90
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    91
-- team with most skips
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    92
SendStat(siMaxTurnSkips, "3 teamName")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    93
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    94
-- set 15 kills for team "MyTeam" and overwrite its rank to 3
1885
0a53771f4619 LuaStats: Fix siTeamRank example
Wuzzy
parents: 1842
diff changeset
    95
SendStat(siTeamRank, "3")
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    96
SendStat(siPlayerKills, "15", "MyTeam")
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    97
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    98
</code>
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
    99
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   100
<b>Important:</b>
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   101
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   102
  * As the game engine send stats to the frontend at the end of the game one should send her stats when the game is going to finish and right before the call of `EndGame()`. (Note: Stats are sent from the engine in `CheckForWin`. If conditions are met (win or draw) then `SendStats(uStats)` is called.)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   103
  * Calling just `EndGame()` won’t produce any stats.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   104
  * If one would like to produce a custom graph see also `SendHealthStatsOff()`.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   105
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   106
== <tt>!SendHealthStatsOff()</tt> ==
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   107
Prevents the engine of sending health stats to the frontend. 
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   108
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   109
If any health stats haven’t been sent before this will cause the health graph to the stats page to be hidden. Use this function in the Lua scripts to produce custom graphs by calling it inside `onGameStart()` and using the `SendStat()` function.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   110
f
1764
33ed53a6f370 LuaStats: Remove version info
Wuzzy
parents: 1760
diff changeset
   111
== <tt>!SendAchievementsStatsOff()</tt> ==
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   112
Prevents the engine of populating the snarky comments in the “Details” section (internally known as “achievements”) of the stats screen, such as “best shot award”, etc. So you can start with a clean list when the game ends normally. This function needs to be called inside `onGameStart()`.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   113
1764
33ed53a6f370 LuaStats: Remove version info
Wuzzy
parents: 1760
diff changeset
   114
== <tt>!SendRankingStatsOff()</tt> ==
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   115
Prevents the engine of populating the team rankings in the stats screen, so you can start with a clean list when the game ends normally. This function needs to be called inside `onGameStart()`.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   116
1764
33ed53a6f370 LuaStats: Remove version info
Wuzzy
parents: 1760
diff changeset
   117
== <tt>!SendGameResultOff()</tt> ==
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   118
Prevents the engine of setting the game result text at the top of the stats screen, e.g. “Team 1 wins!” when the game ends normally. This function needs to be called inside `onGameStart()`.
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   119
1764
33ed53a6f370 LuaStats: Remove version info
Wuzzy
parents: 1760
diff changeset
   120
== <tt>!GetTeamStats(teamname)</tt> ==
1749
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   121
Returns a table of internal stats of a team. This table has the following fields:
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   122
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   123
 * `Kills`: Number of kills
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   124
 * `Suicides`: Number of suicides (not yet working)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   125
 * `AIKills`: Number of AI kills
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   126
 * `TeamKills`: Number of hedgehogs killes in own team (excluding current hedghog)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   127
 * `TurnSkips`: Number of skipped turns
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   128
 * `TeamDamage`: Damage inflicted to own team (excluding current hedgehog)
91756d20ce3e Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
diff changeset
   129