Dungeon Leaderboard Source
Dungeon Leaderboard Source
The rows of a gui_leaderboard made from the statistics of the dungeons: put this entry in the source field of the leaderboard. The leaderboard keeps its order, limit, includeZero and row texts; this entry says what is ranked and how the numbers read. Every player who ever played is listed, online or not. The row texts of the leaderboard can use {name}, {score} (the ranking statistic, formatted), {score_raw} and {value_<key>} for each statistic of values, where <key> is the key of the statistic (damage_dealt, best_time...). {score_raw} is what the ranking compares (health is scaled by 10^decimals to stay a whole number); {value_<key>_raw} is the bare number of the statistic, unscaled, as the _raw placeholders write it. A player without a value for the ranking statistic has a score of 0: includeZero of the leaderboard hides them. For best_time and the other records where the smallest is the best, set the leaderboard order to ASCENDING. The lifetime rows are kept until a run is paid out, so opening the menu does not recompute them.
字段
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
artifacts | List<Ref<DungeonArtifactEntry>> | empty | The 'Dungeon Artifact' entries whose statistics are ranked. Several make one global board: counters add up, records keep the best. Entries that share an artifactId are one file and count once. |
scope | DungeonBoardScope | LIFETIME | LIFETIME: every player of the artifacts, with their statistics since the beginning. CURRENT_RUN: the members of the run the viewer is in, with what they did so far in it (nobody when the viewer is not in a run). |
rankBy | DungeonStat | RUNS_COMPLETED | The statistic that decides the rank and is written as {score}. Records where the smallest is best (best_time...) need the leaderboard order ASCENDING. current_health only exists in CURRENT_RUN. |
values | List<DungeonStat> | empty | Statistics written into each row, one {value_<key>} each (for instance {value_damage_dealt}), and {value_<key>_raw} for the bare number (the same as the _raw placeholders). The ranking statistic is always available too. |
durationFormat | Var<String> | {mm}:{ss} | How a duration is written. Tokens: {h} hours, {m} or {mm} minutes (minutes carry the hours unless {h} is used), {ss} seconds, {SSS} milliseconds. |
decimals | Int | 1 | Decimals of health and rates (damage, health, completion rate). The ranking compares health to this precision: {score_raw} is the rank value, health multiplied by 10^decimals. For the unscaled number use {value_<key>_raw}. |
missingValue | Var<String> | - | Written instead of a value that does not exist: no record yet, health of a member who is offline. Plain text: style it in the row text of the leaderboard. |
unknownName | Var<String> | ? | Written as the name of a player whose name is not known (a record from before names were kept who has not played since). Plain text. |
How to use it
This entry turns the statistics of the dungeons into the rows of a GUI leaderboard. It needs GUI 0.20 or later: with an older GUI the dungeon leaderboard does not load.
- Create the entry and list the Dungeon Artifact entries to rank in
artifacts. Several artifacts make one global board: counters add up and records keep the best. Artifacts that share anartifactIdcount once. - Create a GUI Leaderboard and pick this entry in its
sourcefield. The leaderboard keepsorder,limit,includeZero,rowItem,rowNameandrowLore; itsfacts,scope,group,population,worldsandscoreModeare not used. - Choose what is ranked:
scope,rankByand the statistics to write invalues. Forbest_timeand the other records where the smallest is the best, set theorderof the leaderboard toASCENDING. - Write the row texts with the tokens below, then add a
leaderboardlayout that points at the leaderboard in an Open GUI.
| Field | What to know |
|---|---|
artifacts | The artifacts whose statistics are ranked. |
scope | LIFETIME: every player who ever played, online or not, with their statistics since the beginning. CURRENT_RUN: the members of the run the viewer is in, with what they did so far in it; nobody when the viewer is not in a run. |
rankBy | The statistic that decides the rank and is written as {score}. Default runs_completed. current_health only exists in CURRENT_RUN. |
values | Statistics written into each row, one token each. The ranking statistic is always available too. |
durationFormat | How a duration is written: {h} hours, {m} or {mm} minutes (the minutes carry the hours unless {h} is used), {ss} seconds, {SSS} milliseconds. Default {mm}:{ss}. |
decimals | Decimals of health and rates, 0 to 3, default 1. Health is ranked at this precision. |
missingValue | Written instead of a value that does not exist: no record yet, or the health of a member who is offline. Default -. Plain text. |
unknownName | Written as the name of a player whose name is not known. Default ?. Plain text. |
Tokens of rowName and rowLore, where <key> is the key of a statistic (damage_dealt, best_time...):
| Token | Value |
|---|---|
{rank}, {name} | Place and name of the player. |
{score} | The ranking statistic, formatted. |
{score_raw} | The number the ranking compares: the statistic multiplied by 10 to the power of decimals for a health, the plain number for the other units. |
{value_<key>} | A statistic of values, formatted. |
{value_<key>_raw} | The same statistic as a bare number, not scaled: milliseconds, health points, parts per thousand. |
For example, a rowLore line <gray>Kills: <white>{value_mob_kills} shows the kills of each row when mob_kills is in values.
A player without a value for the ranking statistic has a score of 0, so includeZero of the leaderboard hides them. The LIFETIME rows are kept until a run is paid out, so opening the menu does not recompute them.