SCORINFO

Revision as of 16:50, 2 September 2022 by AKMDM (talk | contribs) (Added the CVar "cl_showplayerids" and edited the descriptions of the other "cl_show..." CVars.)

Template:MessageBox

The scoreboard in a Team LMS game. Notice that dead spectators are drawn with less opacity and without the row's background colour to distinguish them from live players.

SCORINFO is a special lump that allows customization of the built-in scoreboard in Zandronum. This offers ways to change things like which fonts or colours are used, the sizing of elements (headers, columns, rows, gaps, etc.) on the scoreboard, what columns are to be displayed and how players are ordered by them, and more.

By default, this is an unprotected lump, meaning that modders aren't the only people who can benefit from this feature. Regular players are able to write their own SCORINFO lump and save into their skins folder, if they wish to design their own personal scoreboard.

Scoreboard Commands

  • ClearColumns - Deletes any and all previously defined columns. At least one column must be defined afterwards or else Zandronum will throw a fatal error!
  • RemoveColumn - Deletes a single column, if defined, by type for standard columns, or name for custom or composite columns.
Scoreboard <"title name">
{
    // BORDER PROPERTIES
    Border = <"left">, <"middle">, <"right">
    TeamBorder = <"left>, <"middle">, <"right">

    // FONT PROPERTIES
    TitleFont = <font>
    SubtitleFont = <font>
    HeaderFont = <font>
    RowFont = <font>

    // TEXT PROPERTIES
    TitleColor = <text color>
    SubtitleColor = <text color>
    HeaderColor = <text color>
    RowColor = <text color>
    LocalRowColor = <text color>
    LocalRowDemoColor = <text color>
    DeadSpectatorTextOpacity = <value>

    // BACKGROUND PROPERTIES
    BackgroundColor = <color>
    LightRowColor = <color>
    DarkRowColor = <color>
    BackgroundOpacity = <value>
    RowOpacity = <value>
    DeadSpectatorRowOpacity = <value>

    // SIZE AND DIMENSION PROPERTIES
    BackgroundBorderSize = <value>
    GapBetweenTitleAndSubtitles = <value>
    GapBetweenHeaderAndRows = <value>
    GapBetweenSubtitles = <value>
    GapBetweenColumns = <value>
    GapBetweenRows = <value>
    HeaderHeight = <value>
    RowHeight = <value>

    // MISCELLANEOUS
    Flags = <flag1> [, flag2 [, ...]]
    ColumnOrder = <column1> [, column2 [, ...]]
    RankOrder = <column1> [, column2 [, ...]]
    AddToRankOrder = <column>
    DisableInGameMode = <gamemode1> [, gamemode2 [, ...]]
    DisableInGameType = <gametype1> [, gametype2 [, ...]]
    DisableInEarnType = <earntype1> [, earntype2 [, ...]]
}

The scoreboard's title is what gets printed at the top of the scoreboard (e.g. "RANKINGS").

Border Properties

  • Border - Sets the graphics to be used for the main borders.
  • TeamBorder - Sets the graphics to be used for the border that appears underneath the team headers.

Font Properties

  • TitleFont - The font used to draw the title. By default, this is BigFont.
  • SubtitleFont - The font used to draw all of the text that appears underneath the title, including the server hostname, current game mode, and game limits. By default, this is SmallFont.
  • HeaderFont - The font used to draw the column's header. By default, this is SmallFont.
  • RowFont - The font used to draw the rows for each player. By default, this is SmallFont.

Text Properties

  • TitleColor - The text colour to draw the title. By default, this is Red.
  • SubtitleColor - The text colour to draw the header's subtitles (server hostname, current game mode, and game limits). By default, this is Grey.
  • HeaderColor - The text colour used for the column's header. By default, this is Red.
  • RowColor - The text colour used for the rows of all players. By default, this is Grey.
  • LocalRowColor - The text colour used for the row of the player you're spying. By default, this is Green.
  • LocalRowDemoColor - Similar to the local row colour, but only when watching a demo. By default, this is Gold.
  • DeadSpectatorTextOpacity - The opacity of the row's text for dead spectators. By default, this is 0.35.

Background Properties

  • BackgroundColor - The colour of the background behind the entire scoreboard. By default, this is "00 00 00".
  • LightRowColor - The "light" background colour of the row. By default, this is "40 40 40".
  • DarkRowColor - The "dark" background colour of the row. By default, this is "20 20 20".
  • BackgroundOpacity - The opacity of the scoreboard's background. A value of 1.0 represents fully opaque, while 0.0 represents fully transparent.
  • RowOpacity - The opacity of the row's background. This works similarly to BackgroundOpacity.
  • DeadSpectatorRowOpacity - The opacity of the row's background for dead spectators. By default, this is 0.0.

Note: a row's light and dark background colour doesn't have to be exactly "light" or "dark" in any sense. You're welcome to use any two colours, or make them both the same.

Size and Dimension Properties

  • BackgroundBorderSize - The spacing between the edges of the scoreboard's background and the text, in pixels.
  • GapBetweenTitleAndSubtitles - The spacing between the title and subtitles in the scoreboard's header, in pixels.
  • GapBetweenHeaderAndRows - The spacing between the column's header and the player rows, in pixels.
  • GapBetweenSubtitles - The spacing between the different lines of subtitles in the scoreboard's header, in pixels.
  • GapBetweenColumns - The spacing between the columns, in pixels.
  • GapBetweenRows - The spacing between the player rows, in pixels.
  • HeaderHeight - The height of the header. If entered as a negative number, then the height will be added onto the header font's height.
  • RowHeight - The height of each row. If entered as a negative number, then the height will be added onto the row font's height.

Miscellaneous Properties

  • Flags - Can be one of the following:
    • USETEAMTEXTCOLOR - Row text will be printed in the same colour as a player's team in team-based game modes.
    • DONTSHOWHEADER - Prevents the scoreboard's header from being shown.
    • DONTSHOWTEAMHEADERS - Prevents any of the team headers from being shown.
    • DONTDRAWBORDERS - Don't draw any borders on the scoreboard.
    • DONTSEPARATETEAMS - Players aren't divided into their respective teams and appear on a single list. This also disables team headers on the scoreboard.
    • SHOWGAPSINBACKGROUND - Shows the gaps between columns on the row's background.
  • ColumnOrder - By default, columns are ordered from left to right on the scoreboard in the same order that they're defined in. This means that columns defined first will be on the left, while columns defined last will be on the right. If this command is used, the user can decide how exactly they would like to order the columns. Any defined columns missing from this list are put on the right unless EXCLUDEUNLISTEDCOLUMNS is enabled. Columns should be entered in by type for standard columns, or name for custom or composite columns. Any columns defined inside a composite column cannot be used here.
  • RankOrder - This decides how players will be sorted. Columns entered first have the highest priority over those entered last. If no rank order is specified, players can only be sorted by their number. Columns should be entered in by type for standard columns, or name for custom columns.
  • AddToRankOrder - Adds one single column to the end of the rank order list. Columns should be entered in by type for standard columns, or name for custom columns.
  • DisableInGameMode - The scoreboard is disabled entirely in the listed game modes. This can be useful if modders prefer to design their own entire scoreboard via ACS. Refer to GAMEMODE for a list of all built-in game modes.
  • DisableInGameType - If specified, the scoreboard is disabled in game modes that are of the following type: cooperative, deathmatch, or teamgame.
  • DisableInEarnType - If specified, the scoreboard is disabled in game modes where players earn any of the following: kills, frags, points, or wins.

Column Commands

Standard Columns

Standard columns are built-in column types that Zandronum updates on its own. Users are allowed to customize the column to their own liking.

Column <type>
{
    DisplayName = <string>
    ShortName = <string>
    Alignment = <value>
    Width = <value>
    OverrideGap = <value> [, <left | right>]
    Flags = <flag1> [, flag2 [, ...]]
    GameMode = <gamemode1> [, gamemode2 [, ...]]
    GameType = <gametype1> [, gametype2 [, ...]]
    EarnType = <earntype1> [, earntype2 [, ...]]
    CVar = <cvarname>
    [Other]
}
  • The column's type can be one of the following:
    • Name - The player's current name. This may also include player numbers and join queue positions. Every scoreboard must have this column or else Zandronum will throw a fatal error!
    • Index - The player's index number, between 0-63.
    • Time - How long the player has been in the current game, in minutes.
    • Ping - The player's ping measured in milliseconds.
    • Frags - The player's frag count.
    • Points - The player's point count.
    • Wins - The player's win count.
    • Kills - The player's monster kill count.
    • Deaths - The player's death count.
    • Assists - How many times this player earned the "assist" medal.
    • Secrets - How many secrets this player discovered.
    • Lives - How many lives this player still has. This column is disabled if players are supposed to have only one life.
    • Rank - The player's rank. This is not the same as the rank order on the scoreboard.
    • Spread - The player's spread from whoever is first place.
    • Vote - What decision this player made for the current vote, either "Yes", "No", or blank if they haven't voted yet. This column is disabled if there's no vote in progress.
    • Country - The country that a player is connecting from.
    • Color - The current colour that this player is using. This should not be confused with the Color data type used for custom columns.
    • StatusIcon - A mini icon to indicate the status of the player (i.e. chatting, in console/menu, lagging, ready to go).
    • ScoreIcon - The ScoreIcon of the player's class. This column is disabled if there are no players using classes with score icons.
    • ArtifactIcon - A mini icon for when a player is carrying a terminator sphere, possession hellstone, the white flag, or another team's item. This column is disabled in game modes that don't use these items.
    • BotSkillIcon - A mini icon to indicate the skill level of a bot. This column is disabled if there are no bots in the game.
  • DisplayName - Determines what will be used in the column's header. If this property isn't specified, then the display name will use the same text as its type instead.
  • ShortName - A shorter or abbreviated version of the column's display name, used if the scoreboard is too wide to fit on the user's screen and needs to be shrunken down as much as possible. If unspecified, the display name will always be used.
  • Alignment - Determines how the contents of the column are aligned, and can be one of the following: left, center, or right. By default, the column is aligned to the left.
  • Width - The maximum width of the column, in pixels. In case the scoreboard is too wide and needs to be shrunken down, this column could be narrower than what's specified.
  • OverrideGap - This overrides the value of ColumnGap from the scoreboard block to control the amount of spacing from the column that comes from the left or right, or both, of this one.
  • Flags - Can be one of the following:
    • REVERSEORDER - Sorts players in reverse (i.e. from least to greatest).
    • INTERMISSIONONLY - This column only appears on the intermission screen.
    • NOINTERMISSION - This column won't appear on the intermission screen.
    • NOSPECTATORS - Don't draw values on rows for true spectators.
    • OFFLINEONLY - This column only appears in offline games.
    • ONLINEONLY - This column only appears in online games.
    • HIDDENBYDEFAULT - Don't show this column at the start of the game.
    • DONTSHOWHEADER - Prevents this column's header from being shown.
    • DONTRESETONLEVELCHANGE - This column's values won't be reset to their default when the level changes. This only works on custom columns.
  • GameMode - A list of game modes where this column is active. By default, columns are active in all game modes. Refer to GAMEMODE for a list of all built-in game modes.
  • GameType - If specified, this column is active in game modes that are of the following type: cooperative, deathmatch, or teamgame.
  • EarnType - If specified, this column is active in game modes where players earn any of the following: kills, frags, points, or wins.
  • CVar - If a boolean or integer CVar is specified, then the column is hidden when the CVar is zero and revealed when non-zero.

Other Properties

  • RequiresTeams - This column is only active in game modes that support teams (e.g. TDM, TLMS, CTF).
  • RequiresNoTeams - This column is disabled in game modes that support teams.
  • RequiresLives - This column is only active in game modes where players have lives (e.g. Survival, LMS, TLMS).
  • RequiresNoLives - This column is disabled in game modes that use lives.
  • RequiresTeamItem - This column is only active in game modes where a team's item is used (e.g. CTF or Skulltag).
  • RequiresNoTeamItem - This column is disabled in game modes that use team items.

Custom Columns

Modders can define custom columns for their own needs. They will be responsible for updating the values of these columns on their own via ACS. Custom columns support all the commands as standard columns, plus a few extra commands.

CustomColumn <data type>, <name>
{
    DefaultValue = <value>
    TeamValueMethod = <string>

    // BOOL COLUMN PROPERTIES
    TrueText = <string>
    FalseText = <string>

    // INT, BOOL, FLOAT, AND STRING COLUMN PROPERTIES
    Length = <value>

    // COLOR AND TEXTURE PROPERTIES
    ClipRectWidth = <value>
    ClipRectHeight = <value>
}
  • A column's data type can be one of the following:
    • Int - Draws the column contents as an integer.
    • Bool - Treats the column as a boolean and draws two different strings depending on the value:
      • TrueText - What's shown if the value is 1. By default, this is "true".
      • FalseText - What's shown if the value is 0. By default, this is "false".
    • Float - Draws the column's contents as a float or fixed-point number.
    • String - Draws the column's contents as text.
    • Color - Draws the column with a single hexadecimal colour. A rectangular box is filled inside the column:
      • ClipRectWidth - The width of the box where the colour is drawn. If zero or unspecified, then it's the same as the column's width.
      • ClipRectHeight - The height of the box where the colour is drawn. If zero or unspecified, then it's the same as the row height.
    • Texture: Draws the column with a graphic or texture. The name of the graphic must be entered as a string.
      • ClipRectWidth - The maximum width of the image that will be drawn, from the left-side of the image. If zero or unspecified, then there's no cut-off width.
      • ClipRectHeight - The maximum height of the image that will be drawn, from the top-side of the image. If zero or unspecified, then it's the same as the row height.
  • The column's name is what's used to reference the column. ACS functions use this name to find the column.
  • DefaultValue - The default value of this column at the start of a new game.
  • TeamValueMethod - Determines how the value of this column (only works for int and float types) on a team's header is determined:
    • None - The value will not be drawn on any team header. This is the default behaviour of all custom columns.
    • Sum - Calculates the total value of all players on the team.
    • Average - Calculates the average value of all players on the team.
    • Median - Uses the middle value of all players on the team, from least to greatest.
    • Mode - Uses the most common value of all players on the team.
    • Max - Uses the player's value that is the highest on their team.
    • Min - Uses the player's value that is the lowest on their team.
    • Custom - The modder is responsible for updating the team's value on their own via SetColumnValue in ACS.
  • Length - This has different implications depending on the data type:
    • Int - Limits the number of digits that are shown. This means that a number like 255 will appear as "99" if only two digits are allowed.
    • Float - Limits the number of decimals that are shown. This means that a number like 3.14159 will appear as "3.14" if only two decimals are allowed.
    • Bool and String - Limits the number of characters. Longer messages are truncated with an ellipsis at the end.

Composite Columns

Composite columns can be used when multiple columns, whether standard or custom, must appear under a single DisplayName or ShortName. For example, a player's Name, Color, or StatusIcon are typically grouped together and would look nicer if they're all placed under a single "Name" header. Therefore, a composite column would be useful here.

CompositeColumn <name>
{
    DisplayName = <string>
    ShortName = <string>
    Alignment = <value>
    ColumnOrder = <column1> [, column2 [, ...]]

    Column "Type1"
    {
        ...
    }

    Column "Type2"
    {
        ...
    }

    CustomColumn "Type3"
    {
        ...
    }
}
  • The name is what's used to reference the composite column, similar to custom columns.
  • When a column is defined inside a composite column block, its own DisplayName or ShortName are never used, but instead replaced by what the composite column uses.
  • Alignment controls the alignment of the header text on the composite column, but the individual columns still control the alignment of their own contents.
  • ColumnOrder controls the order of the columns from left to right. Only columns defined inside the composite column block can be used in the order.

Console Variables

Command Data Type Default Description
cl_colorizepings Bool false If true, everyone's ping is printed in different colours that visually indicate how severe their connection is to the server:
  • Green if between 0-99 ms.
  • Yellow if between 100-149 ms.
  • Orange if between 150-199 ms.
  • Red if 200 ms or greater.
cl_intermissiontimer Bool false If true, a message appears on the intermission screen to show how much time is left until the next level starts and the name of the level being entered into.
cl_maxscoreboardheight Float 0.9 The maximum height of the scoreboard as a percentage of the screen's height (must be greater than 0.0 and no greater than 1.0).
cl_maxscoreboardwidth Float 0.9 The maximum width of the scoreboard as a percentage of the screen's width.
cl_scoreboardalpha Float 1.0 The opacity of the scoreboard, from anywhere between 0.0 and 1.0.
cl_showcolorcolumn Bool true Controls whether the Color column is displayed on the scoreboard, as defined in zandronum.pk3.
cl_showcountrycolumn Int 0 Controls whether the Country column is displayed on the scoreboard, as defined in zandronum.pk3. This also changes how a player's country is displayed:
  1. The column is disabled.
  2. Uses a mini icon of the country's flag.
  3. Uses the country's ISO 3166-1 alpha-2 country code, (e.g. "CA").
  4. Uses the country's ISO 3166-1 alpha-3 country code, (e.g. "CAN").
  5. Uses the country's full name (e.g. "Canada"). Beware of incredibly long names!
cl_showplayerids Bool false Controls whether the Index column is displayed on the scoreboard, as defined in zandronum.pk3.

ACS Functions