SCORINFO: Difference between revisions

From Zandronum Wiki
Tag: Source edit
(Finally did a long overdue update on SCORINFO's documentation. This page is no longer a draft now that this lump is in 3.2.)
Tag: Source edit
Line 1: Line 1:
{{FeatureDraft|a future lump that lets users design their own scoreboard}}
{{SpecialLumpWarning}}
 
{{DevfeatureWarning|version=3.2|type=a [[:Category:Special lumps|special lump]]}}
[[Image:SCORINFO TLMS.png|frame|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.]]
{{Devfeature|3.2|alpha}} this 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. Modders aren't the only people who can benefit from this lump. Regular players can also write their own SCORINFO lump and save into their skins folder, if they wish to design their own personal scoreboard.
 
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 block=
<pre>
<pre>
Scoreboard <"title name">
Scoreboard
{
{
     // BORDER PROPERTIES
     MarginBlock
     Border = <"left">, <"middle">, <"right">
     {
     TeamBorder = <"left>, <"middle">, <"right">
        ...
     }


     // FONT PROPERTIES
     Property = <value>
    TitleFont = <font>
     AddFlag FLAGNAME1
    SubtitleFont = <font>
     RemoveFlag FLAGNAME2
    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 [, ...]]
}
}
</pre>
</pre>


The scoreboard's '''title''' is what gets printed at the top of the scoreboard (e.g. "RANKINGS").
== Properties ==
{| class="wikitable" width="100%"
! style="width: 20%" | Property
! style="width: 80%" | Description
|-
! HeaderFont = "<nowiki><font>"</nowiki>
| The font used to draw the column's header.
|-
! RowFont = "<nowiki><font>"</nowiki>
| The font used to draw the rows for each player.
|-
! HeaderColor = "<text color>"
| The text colour used on the column headers.
|-
! RowColor = "<text color>"
| The text colour used on the rows of all players.
|-
! LocalRowColor = "<text color>"
| The text colour used on the row of the player being spied on.
|-
! LocalRowDemoColor = "<text color>"
| Similar to the '''LocalRowColor''', except only used while watching a demo.
|-
! DeadPlayerTextAlpha = <value>
| The opacity of the row's text for dead players.
|-
! BorderTexture = "<texture>"
| The texture to use to draw the borders, if the '''USETEXTUREFORBORDERS''' flag is enabled. The texture is tiled from left to right along the width of the scoreboard, so ideally, the texture should be seamless.
|-
! LightBorderColor = "<color>"
| The "light" border line colour, if the '''USEHEADERCOLORFORBORDERS''' flag is disabled.
|-
! DarkBorderColor = "<color>"
| The "dark" border line colour, if the '''USEHEADERCOLORFORBORDERS''' flag is disabled.
|-
! BackgroundColor = "<color>"
| The colour of the background drawn behind the entire scoreboard.
|-
! LightRowBackgroundColor = "<color>"
| The "light" colour of the row background.
|-
! DarkRowBackgroundColor = "<color>"
| The "dark" colour of the row background.
|-
! LocalRowBackgroundColor = "<color>"
| The colour of the background of the row corresponding to the player being spied on.
|-
! BackgroundAmount = <value>
| The opacity of the scoreboard's background.
|-
! RowBackgroundAmount = <value>
| The opacity of the row's background.
|-
! DeadPlayerRowBackgroundAmount = <value>
| The opacity of the row's background for dead players.
|-
! BackgroundBorderSize = <value>
| The extra background space surrounding the contents of the scoreboard, in pixels.
|-
! GapBetweenHeaderAndRows = <value>
| The spacing between the column headers and the player rows, in pixels.
|-
! GapBetweenColumns = <value>
| The spacing between the columns, in pixels.
|-
! GapBetweenRows = <value>
| The spacing between each of the player rows, in pixels.
|-
! HeaderHeight = <value>
| The height of the header. If entered as a negative number, then this value is added onto the header font's height.
|-
! RowHeight = <value>
| The height of each rows. If entered as a negative number, then this value is added onto the row font's height.
|-
! ColumnOrder = <column> [, ...]
| Controls the order in which columns appear on the scoreboard, from left to right. Both data columns and composite columns may be included in this list. A few things to note:
# Any data columns nested inside composite columns cannot be included in this list. Instead, the composite column should be added to the column order.
# If the list is redefined and some columns are removed from the list, then they're also removed from the rank order.
|-
! AddToColumnOrder = <column> [, ...]
| Appends the column order list with the listed columns. The new columns will be added on the right side of the scoreboard.
|-
! RemoveFromColumnOrder = <column> [, ...]
| Removes the listed columns from the scoreboard. If any data columns are removed from the column order, then they're also removed from the rank order.
|-
! RankOrder = <column> [, ...]
| Controls the order in which players are ranked on the scoreboard, from top to bottom (e.g. frags, points, wins, kills, etc.). Columns at the beginning of the list have the highest priority, while columns at the end of the list have the least priority. Players with higher values (e.g. a higher frag count) will appear above those with lower values, unless the column enabled the '''REVERSEORDER''' flag, which inverts this behaviour.
'''Only data columns (i.e. no composite columns) can be added to the rank order, and they must already be included in the column order.'''
|-
! AddToRankOrder = <column> [, ...]
| Adds more columns to the rank order list. These columns will have less priority versus those that were already in the list.
|-
! RemoveFromRankOrder = <column> [, ...]
| Removes the listed columns from the rank order list.
|}
'''Note:''' The "light" and "dark" colours used on the borders and row backgrounds are just naming conventions and don't necessarily have to be "light" or "dark" in any sense. You're welcome to use any two colours, or make them both the same.


===Border Properties===
== Flags ==
* '''Border''' - Sets the graphics to be used for the main borders.
* <code>'''USETEAMTEXTCOLOR'''</code>
* '''TeamBorder''' - Sets the graphics to be used for the border that appears underneath the team headers.
:The row text will be printed in the same colour as the player's team in team-based game modes.
* <code>'''USEHEADERCOLORFORBORDERS'''</code>
:The text colour of the headers is automatically used to colour the border lines that surround the column headers.
* <code>'''USETEXTUREFORBORDERS'''</code>
:Instead of drawing the borders as a series of lines whose colours are controlled by '''LightBorderColor''' and '''DarkBorderColor''', the texture specified in '''BorderTexture''' is used to draw the borders instead.        
* <code>'''SHOWGAPSINROWBACKGROUND'''</code>
:Reveals the gaps between columns in the row's background.
* <code>'''DONTDRAWBORDERS'''</code>
:Prevents any borders from being drawn.
* <code>'''DONTSEPARATETEAMS'''</code>
:Players aren't separated into their respective teams and appear on a single list. This also implies that team headers aren't drawn, though the spectator header is still visible.
* <code>'''DONTUSELOCALROWBACKGROUNDCOLOR'''</code>
:Prevents '''LocalRowBackgroundColor''' from being used to draw the background of the row that corresponds to the player being spied on.
* <code>'''DONTSHOWTEAMHEADERS'''</code>
:Prevents the team headers and the spectator header from being shown.


===Font Properties===
== Margin blocks ==
* '''TitleFont''' - The font used to draw the title. By default, this is <i>BigFont</i>.
There are four types of margins:
* '''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 <i>SmallFont</i>.
* '''MainHeader''': appears above the column headers and player rows.
* '''HeaderFont''' - The font used to draw the column's header. By default, this is <i>SmallFont</i>.
* '''TeamHeader''': appear above all players row of a single team.
* '''RowFont''' - The font used to draw the rows for each player. By default, this is <i>SmallFont</i>.
* '''SpectatorHeader''': appears above all true spectator player rows.
* '''Footer''': appears underneath all player rows.


===Text Properties===
{| class="wikitable" width="100%"
* '''TitleColor''' - The text colour to draw the title. By default, this is <i>Red</i>.
! style="width: 20%" | Command
* '''SubtitleColor''' - The text colour to draw the header's subtitles (server hostname, current game mode, and game limits). By default, this is <i>Grey</i>.
! style="width: 80%" | Description
* '''HeaderColor''' - The text colour used for the column's header. By default, this is <i>Red</i>.
|-
* '''RowColor''' - The text colour used for the rows of all players. By default, this is <i>Grey</i>.
! [[MultiLineBlock]]
* '''LocalRowColor''' - The text colour used for the row of the player you're spying. By default, this is <i>Green</i>.
| Starts a block of lines that consist of strings, colors, or textures.
* '''LocalRowDemoColor''' - Similar to the local row colour, but only when watching a demo. By default, this is <i>Gold</i>.
|-
* '''DeadSpectatorTextOpacity''' - The opacity of the row's text for dead spectators. By default, this is 0.35.
! [[RowBlock]]
| Starts a row that consists of strings, colors, or textures.
|-
! [[DrawString]]
| Draws text somewhere in the margin.
|-
! [[DrawColor]]
| Draws a color box somewhere in the margin.
|-
! [[DrawTexture]]
| Draws a graphic or image somewhere in the margin.
|-
! IfOnlineGame( <true/false> )
| Executes a block if the current game is (not) a network game.
|-
! IfIntermission( <true/false> )
| Executes a block if the intermission screen is (not) being shown.
|-
! IfPlayersOnTeams( <true/false> )
| Executes a block if players are (not) supposed to be on teams.
|-
! IfPlayersHaveLives( <true/false> )
| Executes a block if players are (not) supposed to have lives.
|-
! IfShouldShowRank( <true/false> )
| Executes a block if the current player's rank should (not) be shown.
|-
! IfGameMode( <gamemode> [, ...] )
| Executes a block when any of the given game modes are being played.
|-
! IfGameType( <gametype> [, ...] )
| Executes a block when any of the given game types are being played. Possible values are '''cooperative''', '''deathmatch''', and '''teamgame'''.
|-
! IfEarnType( <earntype> [, ...] )
| Executes a block when players can earn any of the given types. Possible values are '''frags''', '''points''', '''wins''', and '''kills'''.
|-
! [[IfCVar]]
| Executes a block depending on a CVar's value.
|}


===Background Properties===
= Column block =
* '''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:
** <code>USETEAMTEXTCOLOR</code> - Row text will be printed in the same colour as a player's team in team-based game modes.
** <code>DONTSHOWHEADER</code> - Prevents the scoreboard's header from being shown.
** <code>DONTSHOWTEAMHEADERS</code> - Prevents any of the team headers from being shown.
** <code>DONTDRAWBORDERS</code> - Don't draw any borders on the scoreboard.
** <code>DONTSEPARATETEAMS</code> - Players aren't divided into their respective teams and appear on a single list. '''This also disables team headers on the scoreboard.'''
** <code>SHOWGAPSINBACKGROUND</code> - 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 <code>EXCLUDEUNLISTEDCOLUMNS</code> 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.
<pre>
<pre>
Column <type>
Column "<columnname>"
{
{
     DisplayName = <string>
     Property = <value>
    ShortName = <string>
     AddFlag FLAGNAME1
    Alignment = <value>
     RemoveFlag FLAGNAME2
    Width = <value>
    OverrideGap = <value> [, <left | right>]
     Flags = <flag1> [, flag2 [, ...]]
    GameMode = <gamemode1> [, gamemode2 [, ...]]
    GameType = <gametype1> [, gametype2 [, ...]]
    EarnType = <earntype1> [, earntype2 [, ...]]
    CVar = <cvarname>
     [Other]
}
}
</pre>
</pre>


*The column's '''type''' can be one of the following:
== Native types==
**<code>Name</code> - 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!'''
{| class="wikitable" width="100%"
**<code>Index</code> - The player's index number, between 0-63.
! style="width: 10%" | Type
**<code>Time</code> - How long the player has been in the current game, in minutes.
! style="width: 10%" | Data type
**<code>Ping</code> - The player's ping measured in milliseconds.
! style="width: 80%" | Description
**<code>Frags</code> - The player's frag count.
|-
**<code>Points</code> - The player's point count.
! Name
**<code>Wins</code> - The player's win count.
| style="text-align:center;" | String
**<code>Kills</code> - The player's monster kill count.
| The name this player is using.
**<code>Deaths</code> - The player's death count.
|-
**<code>Assists</code> - How many times this player earned the "assist" medal.
! Index
**<code>Secrets</code> - How many secrets this player discovered.
| style="text-align:center;" | Int
**<code>Lives</code> - How many lives this player still has. '''This column is disabled if players are supposed to have only one life.'''
| The player's index number.
**<code>Rank</code> - The player's rank. This is not the same as the rank order on the scoreboard.
|-
**<code>Spread</code> - The player's spread from whoever is first place.
! Time
**<code>Vote</code> - 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.'''
| style="text-align:center;" | Int
**<code>Country</code> - The country that a player is connecting from.
| How long this player has been playing in the current game.
**<code>Color</code> - The current colour that this player is using. This should not be confused with the <code>Color</code> data type used for custom columns.
|-
**<code>StatusIcon</code> - A mini icon to indicate the status of the player (i.e. chatting, in console/menu, lagging, ready to go).
! Ping
**<code>ScoreIcon</code> - The [https://zdoom.org/wiki/Actor_properties#Player.ScoreIcon ScoreIcon] of the player's class. '''This column is disabled if there are no players using classes with score icons.'''
| style="text-align:center;" | Int
**<code>ArtifactIcon</code> - 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.'''
| The player's ping measured in milliseconds.
**<code>BotSkillIcon</code> - A mini icon to indicate the skill level of a bot. '''This column is disabled if there are no bots in the game.'''
|-
! Frags
| style="text-align:center;" | Int
| The player's current frag count.
|-
! Points
| style="text-align:center;" | Int
| The player's current point count.
|-
! Wins
| style="text-align:center;" | Int
| The player's current win count.
|-
! Kills
| style="text-align:center;" | Int
| The player's current kill count.
|-
! Deaths
| style="text-align:center;" | Int
| How many times this player has died.
|-
! Secrets
| style="text-align:center;" | Int
| The number of secrets this player has discovered.
|-
! Lives
| style="text-align:center;" | Int
| The number of lives this player still has.
|-
! Damage
| style="text-align:center;" | Int
| How much damage this player has dealt in a cooperative game, if [[DMFlags|sv_awarddamageinsteadkills]] is enabled.
|-
! Handicap
| style="text-align:center;" | Int
| The player's handicap value.
|-
! JoinQueue
| style="text-align:center;" | Int
| The player's position in the join queue.
|-
! Vote
| style="text-align:center;" | String
| What decision this player made for the current vote.
|-
! StatusIcon
| style="text-align:center;" | Texture
| Shows a mini icon that represents the player's current status (e.g. chatting, in the console or menu, or lagging).
|-
! ReadyToGoOn
| style="text-align:center;" | Texture
| Shows a mini icon to indicate whether or not the player is ready to go during the intermission.
|-
! ScoreIcon
| style="text-align:center;" | Texture
| The icon indicated by the '''Player.ScoreIcon''' property of the player's current class.
|-
! ArtifactIcon
| style="text-align:center;" | Texture
| Shows an icon if this player is carrying a gamemode-specific item (e.g. terminator sphere, hellstone, the white flag, or another team's flag/skull).
|-
! BotSkillIcon
| style="text-align:center;" | Texture
| A mini icon that indicates the skill level of a bot.
|-
! CountryName
| style="text-align:center;" | String
| The full name of the country that the player is connecting from.
|-
! CountryCode
| style="text-align:center;" | String
| The country code that the player is connecting from.
|-
! CountryFlag
| style="text-align:center;" | Texture
| A mini icon of the flag of the country that the player is connecting from. The icons are organized in a 16x16 grid, inside a single texture called "CTRYFLAG".
|}


*'''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.
== Properties ==
*'''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.
{| class="wikitable" width="100%"
*'''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.
! style="width: 20%" | Property
*'''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.
! style="width: 10%" | Used for
*'''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.
! style="width: 70%" | Description
*'''Flags''' - Can be one of the following: 
|-
**<code>REVERSEORDER</code> - Sorts players in reverse (i.e. from least to greatest).
! DisplayName = "<name>"
**<code>INTERMISSIONONLY</code> - This column only appears on the intermission screen.
| style="text-align:center;" | Any
**<code>NOINTERMISSION</code> - This column won't appear on the intermission screen.
| The name that is used in the column's header.
**<code>NOSPECTATORS</code> - Don't draw values on rows for true spectators.
|-
**<code>OFFLINEONLY</code> - This column only appears in offline games.
! ShortName = "<name>"
**<code>ONLINEONLY</code> - This column only appears in online games.
| style="text-align:center;" | Any
**<code>HIDDENBYDEFAULT</code> - Don't show this column at the start of the game.
| A shorter or abbreviated version of the display name that's used when ''cl_useshortcolumnnames'' is enabled.
**<code>DONTSHOWHEADER</code> - Prevents this column's header from being shown.
|-
**<code>DONTRESETONLEVELCHANGE</code> - This column's values won't be reset to their default when the level changes. '''This only works on custom columns.'''
! Alignment = <alignment>
*'''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.
| style="text-align:center;" | Any
*'''GameType''' - If specified, this column is active in game modes that are of the following type: '''cooperative''', '''deathmatch''', or '''teamgame'''.
| How the contents inside the column are aligned. Possible values are '''left''', '''center''', or '''right'''.
*'''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.
! Size = <value>
 
| style="text-align:center;" | Any
=== Other Properties===
| The size of the column, in pixels. This is the column's whole width, or padding if the '''ALWAYSUSESHORTESTWIDTH''' flag is enabled.
*'''RequiresTeams''' - This column is only active in game modes that support teams (e.g. TDM, TLMS, CTF).
'''If the column's header or contents can't fit inside its ''size'', then the width will be increased to something large enough to fit everything.'''
*'''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).
! GameMode = <gamemode> [, ...]
*'''RequiresNoLives''' - This column is disabled in game modes that use lives.
| style="text-align:center;" | Any
*'''RequiresTeamItem''' - This column is only active in game modes where a team's item is used (e.g. CTF or Skulltag).
| A list of game modes where this column is only active in. If unspecified, then the column in active in all game modes.
*'''RequiresNoTeamItem''' - This column is disabled in game modes that use team items.
|-
 
!GameType = <gametype> [, ...]
==Custom Columns==
| style="text-align:center;" | Any
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.
|The game types which this column is only active in. Possible values are '''cooperative''', '''deathmatch''', and '''teamgame'''. In unspecified, then the column is active in all game types.
<pre>
|-
CustomColumn <data type>, <name>
! EarnType = <earntype> [, ...]
{
| style="text-align:center;" | Any
    DefaultValue = <value>
| What kind of score the players must earn for this column to be active. Possible values are '''frags''', '''points''', '''wins''', and '''kills'''. By default, columns are active for all earn types.
    TeamValueMethod = <string>
|-
 
! CVar = "<cvarname>"
    // BOOL COLUMN PROPERTIES
| style="text-align:center;" | Any
    TrueText = <string>
| If a CVar is specified, then its value will decide if this column is active (if non-zero) or disabled. Enabling the '''CVARMUSTBEZERO''' flag reverses this behaviour.
    FalseText = <string>
'''The CVar must be either an integer, boolean, or a flag.'''
 
|-
    // INT, BOOL, FLOAT, AND STRING COLUMN PROPERTIES
! MaxLength = <value>
    Length = <value>
| style="text-align:center;" | Bool, Float, String
 
| Limits how many decimals (for the float data type), or characters (for bool and string data types) are shown.
    // COLOR AND TEXTURE PROPERTIES
    ClipRectWidth = <value>
    ClipRectHeight = <value>
}
</pre>
 
* A column's '''data type''' can be one of the following:
**<code>Int</code> - Draws the column contents as an integer.
**<code>Bool</code> - 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".
**<code>Float</code> - Draws the column's contents as a float or fixed-point number.
**<code>String</code> - Draws the column's contents as text.
**<code>Color</code> - 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.
**<code>Texture</code>: 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:
**<code>None</code> - The value will not be drawn on any team header. This is the default behaviour of all custom columns.
**<code>Sum</code> - Calculates the total value of all players on the team.
**<code>Average</code> - Calculates the average value of all players on the team.
**<code>Median</code> - Uses the middle value of all players on the team, from least to greatest.
**<code>Mode</code> - Uses the most common value of all players on the team.
**<code>Max</code> - Uses the player's value that is the highest on their team.
**<code>Min</code> - Uses the player's value that is the lowest on their team.
**<code>Custom</code> - 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:
**<code>Int</code> - 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.
**<code>Float</code> - 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.
**<code>Bool</code> and <code>String</code> - 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 <code>Name</code>, <code>Color</code>, or <code>StatusIcon</code> 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.
<pre>
CompositeColumn <name>
{
    DisplayName = <string>
    ShortName = <string>
    Alignment = <value>
    ColumnOrder = <column1> [, column2 [, ...]]
 
    Column "Type1"
    {
        ...
    }
 
    Column "Type2"
    {
        ...
    }
 
    CustomColumn "Type3"
    {
        ...
    }
}
</pre> 
 
* 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=
{| class="wikitable" width="100%" border="2"
|-
|-
!Command<!-- Command name -->
! Prefix = "<text>"
! Data Type
| style="text-align:center;" | Int, Bool, Float, String
!Default
|The text that will be added to the beginning of a value.
!Description<!-- What does the command do? -->
|-
|-
|'''cl_colorizepings'''
! Suffix = "<text>"
| style="text-align:center" |Bool
| style="text-align:center;" | Int, Bool, Float, String
| style="text-align:center" |false
| The text that will be added to the end of a value.
|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'''
! ClipRectWidth = <value>
| style="text-align:center" |Bool
| style="text-align:center;" | Color, Texture
| style="text-align:center" |false
| The width of the clipping rectangle. Any pixels outside of the clipping rectangle aren't drawn.
|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'''
! ClipRectHeight = <value>
| style="text-align:center" |Float
| style="text-align:center;" | Color, Texture
| style="text-align:center" |0.9
| The height of the clipping rectangle.
|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'''
! TrueText = "<text>"
| style="text-align:center" |Float
| style="text-align:center;" | Bool
| style="text-align:center" |0.9
| The text that is drawn when a player's value is 1 (or true).
|The maximum width of the scoreboard as a percentage of the screen's width.
|-
|-
|'''cl_scoreboardalpha'''
! FalseText = "<text>"
| style="text-align:center" |Float
| style="text-align:center;" | Bool
| style="text-align:center" |1.0
| The text that is drawn when a player's value is 0 (or false).
|The opacity of the scoreboard, from anywhere between 0.0 and 1.0.
|-
|-
|'''cl_showcolorcolumn'''
! Columns = <column> [, ...]
| style="text-align:center" |Bool
| style="text-align:center;" | Composite
| style="text-align:center" |true
| Specifies which data columns belong to the composite column, and their order from left to right. A few things to note:
| Controls whether the <code>Color</code> column is displayed on the scoreboard, as defined in zandronum.pk3.
# The data columns cannot already be inside another composite column.
# The data columns cannot be included in the scoreboard's column order.
# The data columns must always have the '''DONTSHOWHEADER''' flag enabled, and be aligned to the left.
# If the list is redefined and some columns are removed from the list, then they're also removed from the scoreboard's rank order.
|-
|-
|'''cl_showcountrycolumn'''
! AddToColumns = <column> [, ...]
| style="text-align:center" |Int
| style="text-align:center;" | Composite
| style="text-align:center" |0
| Appends the composite column's list with the listed columns. The new columns will be added on the right.
|Controls whether the <code>Country</code> column is displayed on the scoreboard, as defined in zandronum.pk3. This also changes how a player's country is displayed:
<ol start="0">
<li>The column is disabled.</li>
<li> Uses a mini icon of the country's flag.</li>
<li>Uses the country's [[wikipedia:ISO_3166-1_alpha-2#Officially_assigned_code_elements|ISO 3166-1 alpha-2]] country code, (e.g. "CA").</li>
<li>Uses the country's [[wikipedia:ISO_3166-1_alpha-3#Officially_assigned_code_elements|ISO 3166-1 alpha-3]] country code, (e.g. "CAN").</li>
<li> Uses the country's full name (e.g. "Canada"). '''Beware of incredibly long names!'''</li>
</ol>
|-
|-
|'''cl_showplayerids'''
! RemoveFromColumns = <column> [, ...]
| style="text-align:center" |Bool
| style="text-align:center;" | Composite
| style="text-align:center" |false
| Removes the listed columns from the composite column's list. If any data columns are removed from the list, then they're also removed from the scoreboard's rank order.
|Controls whether the <code>Index</code> column is displayed on the scoreboard, as defined in zandronum.pk3.
|}
|}


=Scoreboard ACS Functions=
== Flags ==
*<code>[[GetColumnStatus]]</code>
* <code>'''REVERSEORDER'''</code>
*<code>[[GetColumnDataType]]</code>
:By default, players are sorted from highest to lowest value in a column. By enabling this flag, players will be sorted from lowest to highest value instead.
*<code>[[GetPlayerColumnValue]]</code>
* <code>'''INTERMISSIONONLY'''</code>
*<code>[[GetScoreboardStatus]]</code>
:The column is only active on the intermission screen.
*<code>[[GetTeamColumnValue]]</code>
* <code>'''NOINTERMISSION'''</code>
*<code>[[HideColumn]]</code>
:The column is disabled on the intermission screen.
*<code>[[HideScoreboard]]</code>
* <code>'''NOSPECTATORS'''</code>
*<code>[[SetPlayerColumnValue]]</code>
:The contents of this column are never drawn for true spectators.
*<code>[[SetTeamColumnValue]]</code>
* <code>'''OFFLINEONLY'''</code>
:The column is only active in offline (i.e. singleplayer or with bots) games, and never used in online games.
* <code>'''ONLINEONLY'''</code>
:The column is only active in online games, and never used in offline games.
* <code>'''REQUIRESTEAMS'''</code>
:This column is only active in game modes that support teams.
* <code>'''FORBIDTEAMS'''</code>
:Disables the column in game modes that support teams.
* <code>'''REQUIRESLIVES'''</code>
:This column is only active in game modes where players have lives.
* <code>'''FORBIDLIVES'''</code>
:Disables the column in game modes that use lives.
* <code>'''REQUIRESTEAMITEMS'''</code>
:This column is only active in game modes where a team's item is used.
* <code>'''FORBIDTEAMITEMS'''</code>
:Disables the column in game modes that use team items.
* <code>'''DONTSHOWHEADER'''</code>
:Prevents the column's header from being shown.
* <code>'''ALWAYSUSESHORTESTWIDTH'''</code>
:The width of the column is set to whatever's small enough to still fit everything (i.e. the header and contents) inside of it. The column's '''size''' will be treated as a padding and increase its width by the specified amount.
* <code>'''CVARMUSTBEZERO'''</code>
:The CVar used by this column uses must be equal to zero (or false) for it to still be active.
* <code>'''DISABLEIFEMPTY'''</code>
:Disables the column whenever it has no contents inside of it.

Revision as of 15:40, 13 June 2023

This article documents a Zandronum-specific special lump which may not be supported by ZDoom and its other child ports.
This article documents a special lump which is only available in development builds of Zandronum 3.2 and newer.

(development version 3.2-alpha and above only) this 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. Modders aren't the only people who can benefit from this lump. Regular players can also write their own SCORINFO lump and save into their skins folder, if they wish to design their own personal scoreboard.

Scoreboard block

Scoreboard
{
    MarginBlock
    {
        ...
    }

    Property = <value>
    AddFlag FLAGNAME1
    RemoveFlag FLAGNAME2
}

Properties

Property Description
HeaderFont = "<font>" The font used to draw the column's header.
RowFont = "<font>" The font used to draw the rows for each player.
HeaderColor = "<text color>" The text colour used on the column headers.
RowColor = "<text color>" The text colour used on the rows of all players.
LocalRowColor = "<text color>" The text colour used on the row of the player being spied on.
LocalRowDemoColor = "<text color>" Similar to the LocalRowColor, except only used while watching a demo.
DeadPlayerTextAlpha = <value> The opacity of the row's text for dead players.
BorderTexture = "<texture>" The texture to use to draw the borders, if the USETEXTUREFORBORDERS flag is enabled. The texture is tiled from left to right along the width of the scoreboard, so ideally, the texture should be seamless.
LightBorderColor = "<color>" The "light" border line colour, if the USEHEADERCOLORFORBORDERS flag is disabled.
DarkBorderColor = "<color>" The "dark" border line colour, if the USEHEADERCOLORFORBORDERS flag is disabled.
BackgroundColor = "<color>" The colour of the background drawn behind the entire scoreboard.
LightRowBackgroundColor = "<color>" The "light" colour of the row background.
DarkRowBackgroundColor = "<color>" The "dark" colour of the row background.
LocalRowBackgroundColor = "<color>" The colour of the background of the row corresponding to the player being spied on.
BackgroundAmount = <value> The opacity of the scoreboard's background.
RowBackgroundAmount = <value> The opacity of the row's background.
DeadPlayerRowBackgroundAmount = <value> The opacity of the row's background for dead players.
BackgroundBorderSize = <value> The extra background space surrounding the contents of the scoreboard, in pixels.
GapBetweenHeaderAndRows = <value> The spacing between the column headers and the player rows, in pixels.
GapBetweenColumns = <value> The spacing between the columns, in pixels.
GapBetweenRows = <value> The spacing between each of the player rows, in pixels.
HeaderHeight = <value> The height of the header. If entered as a negative number, then this value is added onto the header font's height.
RowHeight = <value> The height of each rows. If entered as a negative number, then this value is added onto the row font's height.
ColumnOrder = <column> [, ...] Controls the order in which columns appear on the scoreboard, from left to right. Both data columns and composite columns may be included in this list. A few things to note:
  1. Any data columns nested inside composite columns cannot be included in this list. Instead, the composite column should be added to the column order.
  2. If the list is redefined and some columns are removed from the list, then they're also removed from the rank order.
AddToColumnOrder = <column> [, ...] Appends the column order list with the listed columns. The new columns will be added on the right side of the scoreboard.
RemoveFromColumnOrder = <column> [, ...] Removes the listed columns from the scoreboard. If any data columns are removed from the column order, then they're also removed from the rank order.
RankOrder = <column> [, ...] Controls the order in which players are ranked on the scoreboard, from top to bottom (e.g. frags, points, wins, kills, etc.). Columns at the beginning of the list have the highest priority, while columns at the end of the list have the least priority. Players with higher values (e.g. a higher frag count) will appear above those with lower values, unless the column enabled the REVERSEORDER flag, which inverts this behaviour.

Only data columns (i.e. no composite columns) can be added to the rank order, and they must already be included in the column order.

AddToRankOrder = <column> [, ...] Adds more columns to the rank order list. These columns will have less priority versus those that were already in the list.
RemoveFromRankOrder = <column> [, ...] Removes the listed columns from the rank order list.

Note: The "light" and "dark" colours used on the borders and row backgrounds are just naming conventions and don't necessarily have to be "light" or "dark" in any sense. You're welcome to use any two colours, or make them both the same.

Flags

  • USETEAMTEXTCOLOR
The row text will be printed in the same colour as the player's team in team-based game modes.
  • USEHEADERCOLORFORBORDERS
The text colour of the headers is automatically used to colour the border lines that surround the column headers.
  • USETEXTUREFORBORDERS
Instead of drawing the borders as a series of lines whose colours are controlled by LightBorderColor and DarkBorderColor, the texture specified in BorderTexture is used to draw the borders instead.
  • SHOWGAPSINROWBACKGROUND
Reveals the gaps between columns in the row's background.
  • DONTDRAWBORDERS
Prevents any borders from being drawn.
  • DONTSEPARATETEAMS
Players aren't separated into their respective teams and appear on a single list. This also implies that team headers aren't drawn, though the spectator header is still visible.
  • DONTUSELOCALROWBACKGROUNDCOLOR
Prevents LocalRowBackgroundColor from being used to draw the background of the row that corresponds to the player being spied on.
  • DONTSHOWTEAMHEADERS
Prevents the team headers and the spectator header from being shown.

Margin blocks

There are four types of margins:

  • MainHeader: appears above the column headers and player rows.
  • TeamHeader: appear above all players row of a single team.
  • SpectatorHeader: appears above all true spectator player rows.
  • Footer: appears underneath all player rows.
Command Description
MultiLineBlock Starts a block of lines that consist of strings, colors, or textures.
RowBlock Starts a row that consists of strings, colors, or textures.
DrawString Draws text somewhere in the margin.
DrawColor Draws a color box somewhere in the margin.
DrawTexture Draws a graphic or image somewhere in the margin.
IfOnlineGame( <true/false> ) Executes a block if the current game is (not) a network game.
IfIntermission( <true/false> ) Executes a block if the intermission screen is (not) being shown.
IfPlayersOnTeams( <true/false> ) Executes a block if players are (not) supposed to be on teams.
IfPlayersHaveLives( <true/false> ) Executes a block if players are (not) supposed to have lives.
IfShouldShowRank( <true/false> ) Executes a block if the current player's rank should (not) be shown.
IfGameMode( <gamemode> [, ...] ) Executes a block when any of the given game modes are being played.
IfGameType( <gametype> [, ...] ) Executes a block when any of the given game types are being played. Possible values are cooperative, deathmatch, and teamgame.
IfEarnType( <earntype> [, ...] ) Executes a block when players can earn any of the given types. Possible values are frags, points, wins, and kills.
IfCVar Executes a block depending on a CVar's value.

Column block

Column "<columnname>"
{
    Property = <value>
    AddFlag FLAGNAME1
    RemoveFlag FLAGNAME2
}

Native types

Type Data type Description
Name String The name this player is using.
Index Int The player's index number.
Time Int How long this player has been playing in the current game.
Ping Int The player's ping measured in milliseconds.
Frags Int The player's current frag count.
Points Int The player's current point count.
Wins Int The player's current win count.
Kills Int The player's current kill count.
Deaths Int How many times this player has died.
Secrets Int The number of secrets this player has discovered.
Lives Int The number of lives this player still has.
Damage Int How much damage this player has dealt in a cooperative game, if sv_awarddamageinsteadkills is enabled.
Handicap Int The player's handicap value.
JoinQueue Int The player's position in the join queue.
Vote String What decision this player made for the current vote.
StatusIcon Texture Shows a mini icon that represents the player's current status (e.g. chatting, in the console or menu, or lagging).
ReadyToGoOn Texture Shows a mini icon to indicate whether or not the player is ready to go during the intermission.
ScoreIcon Texture The icon indicated by the Player.ScoreIcon property of the player's current class.
ArtifactIcon Texture Shows an icon if this player is carrying a gamemode-specific item (e.g. terminator sphere, hellstone, the white flag, or another team's flag/skull).
BotSkillIcon Texture A mini icon that indicates the skill level of a bot.
CountryName String The full name of the country that the player is connecting from.
CountryCode String The country code that the player is connecting from.
CountryFlag Texture A mini icon of the flag of the country that the player is connecting from. The icons are organized in a 16x16 grid, inside a single texture called "CTRYFLAG".

Properties

Property Used for Description
DisplayName = "<name>" Any The name that is used in the column's header.
ShortName = "<name>" Any A shorter or abbreviated version of the display name that's used when cl_useshortcolumnnames is enabled.
Alignment = <alignment> Any How the contents inside the column are aligned. Possible values are left, center, or right.
Size = <value> Any The size of the column, in pixels. This is the column's whole width, or padding if the ALWAYSUSESHORTESTWIDTH flag is enabled.

If the column's header or contents can't fit inside its size, then the width will be increased to something large enough to fit everything.

GameMode = <gamemode> [, ...] Any A list of game modes where this column is only active in. If unspecified, then the column in active in all game modes.
GameType = <gametype> [, ...] Any The game types which this column is only active in. Possible values are cooperative, deathmatch, and teamgame. In unspecified, then the column is active in all game types.
EarnType = <earntype> [, ...] Any What kind of score the players must earn for this column to be active. Possible values are frags, points, wins, and kills. By default, columns are active for all earn types.
CVar = "<cvarname>" Any If a CVar is specified, then its value will decide if this column is active (if non-zero) or disabled. Enabling the CVARMUSTBEZERO flag reverses this behaviour.

The CVar must be either an integer, boolean, or a flag.

MaxLength = <value> Bool, Float, String Limits how many decimals (for the float data type), or characters (for bool and string data types) are shown.
Prefix = "<text>" Int, Bool, Float, String The text that will be added to the beginning of a value.
Suffix = "<text>" Int, Bool, Float, String The text that will be added to the end of a value.
ClipRectWidth = <value> Color, Texture The width of the clipping rectangle. Any pixels outside of the clipping rectangle aren't drawn.
ClipRectHeight = <value> Color, Texture The height of the clipping rectangle.
TrueText = "<text>" Bool The text that is drawn when a player's value is 1 (or true).
FalseText = "<text>" Bool The text that is drawn when a player's value is 0 (or false).
Columns = <column> [, ...] Composite Specifies which data columns belong to the composite column, and their order from left to right. A few things to note:
  1. The data columns cannot already be inside another composite column.
  2. The data columns cannot be included in the scoreboard's column order.
  3. The data columns must always have the DONTSHOWHEADER flag enabled, and be aligned to the left.
  4. If the list is redefined and some columns are removed from the list, then they're also removed from the scoreboard's rank order.
AddToColumns = <column> [, ...] Composite Appends the composite column's list with the listed columns. The new columns will be added on the right.
RemoveFromColumns = <column> [, ...] Composite Removes the listed columns from the composite column's list. If any data columns are removed from the list, then they're also removed from the scoreboard's rank order.

Flags

  • REVERSEORDER
By default, players are sorted from highest to lowest value in a column. By enabling this flag, players will be sorted from lowest to highest value instead.
  • INTERMISSIONONLY
The column is only active on the intermission screen.
  • NOINTERMISSION
The column is disabled on the intermission screen.
  • NOSPECTATORS
The contents of this column are never drawn for true spectators.
  • OFFLINEONLY
The column is only active in offline (i.e. singleplayer or with bots) games, and never used in online games.
  • ONLINEONLY
The column is only active in online games, and never used in offline games.
  • REQUIRESTEAMS
This column is only active in game modes that support teams.
  • FORBIDTEAMS
Disables the column in game modes that support teams.
  • REQUIRESLIVES
This column is only active in game modes where players have lives.
  • FORBIDLIVES
Disables the column in game modes that use lives.
  • REQUIRESTEAMITEMS
This column is only active in game modes where a team's item is used.
  • FORBIDTEAMITEMS
Disables the column in game modes that use team items.
  • DONTSHOWHEADER
Prevents the column's header from being shown.
  • ALWAYSUSESHORTESTWIDTH
The width of the column is set to whatever's small enough to still fit everything (i.e. the header and contents) inside of it. The column's size will be treated as a padding and increase its width by the specified amount.
  • CVARMUSTBEZERO
The CVar used by this column uses must be equal to zero (or false) for it to still be active.
  • DISABLEIFEMPTY
Disables the column whenever it has no contents inside of it.