Jump to content

SCORINFO: Difference between revisions

2,375 bytes added ,  22 June 2023
Updated information on SCORINFO, and added more information about data/composite columns and how to use custom columns.
(Updated links of margin commands to match the sub-pages they are, or will be in, and added a sub-heading above the command list.)
Tag: Source edit
(Updated information on SCORINFO, and added more information about data/composite columns and how to use custom columns.)
Tag: Source edit
Line 95: Line 95:
| The height of each rows. If entered as a negative number, then this value is added onto the row font's height.
| The height of each rows. If entered as a negative number, then this value is added onto the row font's height.
|-
|-
! ColumnOrder = <column> [, ...]
! 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:
| 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.
# 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.
# If the list is redefined and some columns are removed from the list, then they're also removed from the rank order.
|-
|-
! AddToColumnOrder = <column> [, ...]
! AddToColumnOrder = "<column>" [, ...]
| Appends the column order list with the listed columns. The new columns will be added on the right side of the scoreboard.
| Appends the column order list with the listed columns. The new columns will be added on the right side of the scoreboard.
|-
|-
! RemoveFromColumnOrder = <column> [, ...]
! 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.
| 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> [, ...]
! 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.
| 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.'''
'''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> [, ...]
! AddToRankOrder = "<column>" [, ...]
| Adds more columns to the rank order list. These columns will have less priority versus those that were already in the list.
| Adds more columns to the rank order list. These columns will have less priority versus those that were already in the list.
|-
|-
! RemoveFromRankOrder = <column> [, ...]
! RemoveFromRankOrder = "<column>" [, ...]
| Removes the listed columns from the rank order list.
| Removes the listed columns from the rank order list.
|}
|}
Line 192: Line 192:


= Column block =
= 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. To define a data column, set up the block like this:
<pre>
<pre>
Column "<columnname>"
Column "<columnname>"
Line 200: Line 204:
}
}
</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.


== Native types==
=== Native types ===
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
! style="width: 10%" | Type
! style="width: 10%" | Type
Line 299: Line 306:
| 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".
| 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 <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'''.
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:
<syntaxhighlight lang="c" line="1">
GameInfo
{
    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.
The custom data can be manipulated using several built-in [[ACS Functions|ACS functions]]:
* <code>[[GetCustomPlayerValue]]</code>
* <code>[[ResetCustomDataToDefault]]</code>
* <code>[[SetCustomPlayerValue]]</code>
== 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:
<pre>
CompositeColumn "<columnname>"
{
    Columns = "<column>" [, ...]
    Property = <value>
    AddFlag FLAGNAME1
    RemoveFlag FLAGNAME2
}
</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 ==
== Properties ==
Line 327: Line 364:
| A list of game modes where this column is only active in. If unspecified, then the column in active in all game modes.
| 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> [, ...]
! GameType = <gametype> [, ...]
| style="text-align:center;" | Any
| 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.
|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.