SCORINFO: Difference between revisions

From Zandronum Wiki
(Created a draft page for the SCORINFO lump (expected to be finished in Zandronum 3.2).)
 
(Added some more relevant information.)
Tag: Source edit
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
{{SpecialLumpWarning}}
{{DevfeatureWarning|version=3.2|type=a [[:Category:Special lumps|special lump]]}}
{{Devfeature|3.2|alpha}} '''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. 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.


{{MessageBox
= Scoreboard block =
|bgcolor=#F88
The scoreboard block is used to change things that affect the entire scoreboard including its properties, what columns should appear and/or used to rank players, and starting margin sub-blocks. The block is set up like this:
|icon=[[File:MedalYouFailIt.png]]
<pre>
|text='''NOTE:''' This article is a draft for a future lump that lets users design their own scoreboard. '''This is not supported in any current Zandronum version!'''
Scoreboard
}}
{
    MarginBlock
    {
        ...
    }


=Scoreboard commands=
    Property = <value>
* '''ClearColumns''' - Deletes any and all previously defined columns. '''At least one column must be defined afterwards or else Zandronum will throw a fatal error!'''
    AddFlag FLAGNAME1
    RemoveFlag FLAGNAME2
}
</pre>


* '''ColumnOrder = <column1> [, column2 [, ...]]''' - 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 will be put on the right. Columns should be entered in by '''type''' for standard columns, or '''name''' for custom columns.
== 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.
|-
! ColumnPadding = <value>
| How much extra padding to leave on both sides of a column, in pixels. This doesn't count as being part of the gap between two columns.
|-
! 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.


* '''RankOrder = <column1> [, column2 [, ...]]''' - 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.
== Flags ==
* <code>'''USETEAMTEXTCOLOR'''</code>
: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.


* '''AddToRankOrder = <column>''' - 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.
== Margin blocks ==
 
Margins are sub-blocks that go inside a scoreboard block and are used to modify special sections on the scoreboard. There are four types of margins:
<pre>
* '''MainHeader''': appears above the column headers and player rows.
HeaderFont = <font>
* '''TeamHeader''': appear above all players row of a single team.
RowFont = <font>
* '''SpectatorHeader''': appears above all true spectator player rows.
HeaderColor = <text color>
* '''Footer''': appears underneath all player rows.
RowColor = <text color>
LocalRowColor = <text color>
LocalRowDemoColor = <text color>
LightRowBackgroundColor = <color>
DarkRowBackgroundColor = <color>
RowBackgroundAmount = <value>
BorderSpacing = <value>
HeaderGap = <value>
ColumnGap = <value>
RowGap = <value>
HeaderHeight = <value>
RowHeight = <value>
</pre>


* '''HeaderFont''' - The font used to draw the column's header. By default, this is <i>SmallFont</i>.
=== Margin commands ===
* '''RowFont''' - The font used to draw the rows for each player. By default, this is <i>SmallFont</i>.
{| class="wikitable" width="100%"
* '''HeaderColor''' - The text colour used for the column's header. By default, this is <i>Red</i>.
! style="width: 20%" | Command
* '''RowColor''' - The text colour used for the rows of all players. By default, this is <i>Grey</i>.
! style="width: 80%" | Description
* '''LocalRowColor''' - The text colour used for the row of the player you're spying. By default, this is <i>Green</i>.
|-
* '''LocalRowDemoColor''' - Similar to the local row colour, but only when watching a demo. By default, this is <i>Gold</i>.
! [[SCORINFO/MultiLineBlock|MultiLineBlock]]
* '''LightRowBackgroundColor''' - The "light" background colour of the row. By default, this is "40 40 40".
| Starts a block of lines that consist of strings, colors, or textures.
* '''DarkRowBackgroundColor''' - The "dark" background colour of the row. By default, this is "20 20 20".
|-
* '''RowBackgroundAmount''' - The opacity of the row's background. A value of 1.0 represents fully opaque, while 0.0 represents fully transparent.
! [[SCORINFO/RowBlock|RowBlock]]
* '''BorderSpacing''' - The spacing between the edges of the scoreboard's background and the text, in pixels.
| Starts a row that consists of strings, colors, or textures.
* '''HeaderGap''' - The spacing between the column's header and the player rows, in pixels.
|-
* '''ColumnGap''' - The spacing between the columns, in pixels.
! [[SCORINFO/DrawString|DrawString]]
* '''RowGap''' - The spacing between the player rows, in pixels.
| Draws text somewhere in the margin.
* '''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.
! [[SCORINFO/DrawColor|DrawColor]]
| Draws a color box somewhere in the margin.
|-
! [[SCORINFO/DrawTexture|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'''.
|-
! [[SCORINFO/IfCVar|IfCVar]]
| Executes a block depending on a CVar's value.
|-
! Else
| Executes the following block if the condition of the previous "if" margin command (e.g. '''IfOnlineGame''') fails.
|}


'''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.
= Column block =
The columns are where all the information on the scoreboard get organized in. There are two types of columns: '''data''' and '''composite'''. Both column types require a ''columnname'' which is the internal name they will use.


=Column commands=
== Data columns ==
==Standard columns==
Data columns are what hold the actual data contents. There are six possible data types: <tt>int</tt>, <tt>bool</tt>, <tt>float</tt>, <tt>string</tt>, <tt>color</tt>, and <tt>texture</tt>. To define a data column, set up the block like this:
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>
     Flags = <flag1> [, flag2 [, ...]]
    GameMode = <gamemode1> [, gamemode2 [, ...]]
    GameType = <gametype1> [, gametype2 [, ...]]
    EarnType = <earntype1> [, earntype2 [, ...]]
     [Flags]
}
}
</pre>
</pre>
Zandronum supports many built-in native column types which already have their own data and are updated automatically. A list of all native column types can be found below.
If the specified ''columnname'' doesn't match that of any native type, then the data column is a '''custom''' column.


* A column's '''type''' can be one of the following:
=== Native types ===
** <code>Name</code> - The player's current name. '''Every scoreboard must have this column or else Zandronum will throw a fatal error!'''
{| class="wikitable" width="100%"
** <code>Time</code> - How long the player has been in the current game, in minutes.
! style="width: 10%" | Type
** <code>Frags</code> - The player's frag count.
! style="width: 10%" | Data type
** <code>Points</code> - The player's point count.
! style="width: 80%" | Description
** <code>Wins</code> - The player's win count.
|-
** <code>Kills</code> - The player's monster kill count.
! Name
** <code>Deaths</code> - The player's death count.
| style="text-align:center;" | String
** <code>Assists</code> - How many times this player earned the "assist" medal.
| The name this player is using.
** <code>Secrets</code> - How many secrets this player discovered.
|-
** <code>Lives</code> - How many lives this player still has.
! Index
| style="text-align:center;" | Int
| The player's index number.
|-
! Time
| style="text-align:center;" | Int
| How long this player has been playing in the current game.
|-
! Ping
| style="text-align:center;" | Int
| The player's ping measured in milliseconds.
|-
! 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.
|-
! PlayerColor
| style="text-align:center;" | Color
| Shows what colour the player is currently using.
|-
! 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.
|-
! PlayerIcon
| style="text-align:center;" | Texture
| The icon indicated by the '''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.
=== How to use custom columns ===
* '''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.
Unlike native columns which already have data, custom columns don't come with data out of the box. So to create a custom column, you must also define the custom data that it will use inside the <code>GameInfo</code> block of a [[MAPINFO]] lump, using the <code>AddCustomData</code> property. '''The name of the custom data must match the name of the custom column'''.
* '''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.
* '''Flags''' - Can be one of the following:
** <code>REVERSEORDER</code> - Sorts players in reverse (i.e. from least to greatest).
** <code>INTERMISSIONONLY</code> - This column only appears on the intermission screen.
** <code>NOINTERMISSION</code> - This column won't appear on the intermission screen.
** <code>NOSPECTATORS</code> - Don't draw the contents of this column for true spectators.
** <code>OFFLINEONLY</code> - This column only appears in offline games.
** <code>ONLINEONLY</code> - This column only appears in online games.
** <code>HIDDENBYDEFAULT</code> - Don't show this column at the start of the game.
** <code>DONTSHOWHEADER</code> - Prevents this column's header from being shown.
* '''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 any game modes that are of the following type: '''cooperative''', '''deathmatch''', or '''teamgame'''.
* '''EarnType''' - If specified, this column is active in any game modes where players earn any of the following: '''kills''', '''frags''', '''points''', or '''wins'''.
* '''RequiresTeams''' - This column is only active in game modes that support teams (e.g. TDM, TLMS, CTF).
* '''RequiresLives''' - This column is only active in game modes where players have lives (e.g. Survival, LMS, TLMS).
* '''RequiresTeamItem''' - This column is only active in game modes where a team's item is used (e.g. CTF or Skulltag).


==Custom columns==
Let's assume, for all intents and purposes, that we created a custom column named "MyCustomColumn" that uses integers with a default value of 0. The custom data would need to be defined like this:
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.
<syntaxhighlight lang="c" line="1">
<pre>
GameInfo
CustomColumn <data type>, <name>
{
{
     DefaultValue = <value>
     AddCustomData = "MyCustomColumn", "int", 0
}
</syntaxhighlight>
Each player has their own value in a custom data set. The value(s) are automatically reset back to default for a single player when they disconnect from the server, or for all players at the start of a new game.


    // Bool column commands
The custom data can be manipulated using several built-in [[ACS Functions|ACS functions]]:
    TrueText = <string>
* <code>[[GetCustomPlayerValue]]</code>
    FalseText = <string>
* <code>[[ResetCustomDataToDefault]]</code>
* <code>[[SetCustomPlayerValue]]</code>


    // Color column commands
== Composite columns ==
    RectWidth = <value>
Composite columns consist of several or more data columns that are tucked underneath a single header - the composite column's. The values of the sub-columns are drawn from left to right. To define a composite column, set up the block like this:
     RectHeight = <value>
<pre>
     Alpha = <value>
CompositeColumn "<columnname>"
{
     Columns = "<column>" [, ...]
     Property = <value>
    AddFlag FLAGNAME1
    RemoveFlag FLAGNAME2
}
}
</pre>
</pre>
'''Note:''' The name of a composite column can't be the same as a native or custom data column. If this happens, Zandronum will throw a fatal error.
== Properties ==
{| class="wikitable" width="100%"
! style="width: 20%" | Property
! style="width: 10%" | Used for
! style="width: 70%" | Description
|-
! DisplayName = "<name>"
| style="text-align:center;" | Any
| The name that is used in the column's header.
|-
! ShortName = "<name>"
| style="text-align:center;" | Any
| A shorter or abbreviated version of the display name that's used when ''cl_useshortcolumnnames'' is enabled.
|-
! Alignment = <alignment>
| style="text-align:center;" | Any
| How the contents inside the column are aligned. Possible values are '''left''', '''center''', or '''right'''.
|-
! Size = <value>
| style="text-align:center;" | 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> [, ...]
| style="text-align:center;" | 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> [, ...]
| style="text-align:center;" | 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> [, ...]
| style="text-align:center;" | 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>"
| style="text-align:center;" | 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>
| 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.
|-
! Prefix = "<text>"
| style="text-align:center;" | Int, Bool, Float, String
|The text that will be added to the beginning of a value.
|-
! Suffix = "<text>"
| style="text-align:center;" | Int, Bool, Float, String
| The text that will be added to the end of a value.
|-
! ClipRectWidth = <value>
| style="text-align:center;" | Color, Texture
| The width of the clipping rectangle. Any pixels outside of the clipping rectangle aren't drawn.
|-
! ClipRectHeight = <value>
| style="text-align:center;" | Color, Texture
| The height of the clipping rectangle.
|-
! TrueText = "<text>"
| style="text-align:center;" | Bool
| The text that is drawn when a player's value is 1 (or true).
|-
! FalseText = "<text>"
| style="text-align:center;" | Bool
| The text that is drawn when a player's value is 0 (or false).
|-
! GapBetweenColumns = <value>
| style="text-align:center;" | Composite
| The spacing between each of the data columns that are inside a composite column, in pixels.
|-
! Columns = <column> [, ...]
| style="text-align:center;" | Composite
| Specifies which data columns belong to the composite column, and their order from left to right. A few things to note:
# 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.
|-
! AddToColumns = <column> [, ...]
| style="text-align:center;" | Composite
| Appends the composite column's list with the listed columns. The new columns will be added on the right.
|-
! RemoveFromColumns = <column> [, ...]
| style="text-align:center;" | 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 ==
* <code>'''REVERSEORDER'''</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>'''INTERMISSIONONLY'''</code>
:The column is only active on the intermission screen.
* <code>'''NOINTERMISSION'''</code>
:The column is disabled on the intermission screen.
* <code>'''NOSPECTATORS'''</code>
:The contents of this column are never drawn for true spectators.
* <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.


* A column's '''data type''' can be one of the following:
[[Category:Zandronum-specific lumps]]
** <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:
*** '''RectWidth''' - The width of the box. If zero or unspecified, this will be the same as the column's width.
*** '''RectHeight''' - The height of the box. If zero or unspecified, this will be the same as the row height.
*** '''Alpha''' - The opacity of the coloured box. By default, this is 1.0 (fully opaque).
** <code>Texture</code>: Draws the column with a graphic or texture. The name of the graphic must be entered as a string.
* 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.

Latest revision as of 19:02, 26 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) 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. 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

The scoreboard block is used to change things that affect the entire scoreboard including its properties, what columns should appear and/or used to rank players, and starting margin sub-blocks. The block is set up like this:

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.
ColumnPadding = <value> How much extra padding to leave on both sides of a column, in pixels. This doesn't count as being part of the gap between two columns.
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

Margins are sub-blocks that go inside a scoreboard block and are used to modify special sections on the scoreboard. 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.

Margin commands

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.
Else Executes the following block if the condition of the previous "if" margin command (e.g. IfOnlineGame) fails.

Column block

The columns are where all the information on the scoreboard get organized in. There are two types of columns: data and composite. Both column types require a columnname which is the internal name they will use.

Data columns

Data columns are what hold the actual data contents. There are six possible data types: int, bool, float, string, color, and texture. To define a data column, set up the block like this:

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

Zandronum supports many built-in native column types which already have their own data and are updated automatically. A list of all native column types can be found below.

If the specified columnname doesn't match that of any native type, then the data column is a custom column.

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.
PlayerColor Color Shows what colour the player is currently using.
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.
PlayerIcon Texture The icon indicated by the 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".

How to use custom columns

Unlike native columns which already have data, custom columns don't come with data out of the box. So to create a custom column, you must also define the custom data that it will use inside the GameInfo block of a MAPINFO lump, using the AddCustomData property. The name of the custom data must match the name of the custom column.

Let's assume, for all intents and purposes, that we created a custom column named "MyCustomColumn" that uses integers with a default value of 0. The custom data would need to be defined like this:

GameInfo
{
    AddCustomData = "MyCustomColumn", "int", 0
}

Each player has their own value in a custom data set. The value(s) are automatically reset back to default for a single player when they disconnect from the server, or for all players at the start of a new game.

The custom data can be manipulated using several built-in ACS functions:

Composite columns

Composite columns consist of several or more data columns that are tucked underneath a single header - the composite column's. The values of the sub-columns are drawn from left to right. To define a composite column, set up the block like this:

CompositeColumn "<columnname>"
{
    Columns = "<column>" [, ...]
    Property = <value>
    AddFlag FLAGNAME1
    RemoveFlag FLAGNAME2
}

Note: The name of a composite column can't be the same as a native or custom data column. If this happens, Zandronum will throw a fatal error.

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).
GapBetweenColumns = <value> Composite The spacing between each of the data columns that are inside a composite column, in pixels.
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.