Sample Nonteam Scoreboard


The Nonteam scoreboard is displayed when you are playing a nonteam game such as FFA. Since there are no team members in these games the scoreboard is laidout differently that a team game scoreboard. The scripted Hud system sets up a specific menuDef for the nonteam scoreboard that must be named score_menu. The rest of the menuDefs in the Hud are hidden and this menuDef is made visible whenever the scoreboard is shown in a nonteam game.

The most important thing about the score_menu menuDef is that it must be invisible by default. This is accomplished by using the visible MENU_FALSE command in the menuDef. Since the scoreboard can cover most of the screen area we set the menuDef's window area to the entire screen with the rect 0 0 640 480 command. Note that the menuDef is not fullscreen.

 

The killer item uses the ownerdraw CG_KILLER command to display the name of the last player to have killed you. It uses the text formatting commands in the item to place the text on the screen.

The ranking of the player in the game is displayed using two items. The rankingbar item displays the colored box that will contain the ranking. The ranking item uses the ownerdraw CG_GAME_STATUS command to display the actual ranking. It is a text item and it text formatting commands in the item to place the text on the screen.

Information about the players is displayed in a box broken up into columns. The titles for each column are placed in their own box, which is displayed by the playerstatsheadingbar item. This draws the colored rectangle that contains the column titles. The column titles are displayed by the standard text items skillheading, statusheading, nameheading, scoreheading, timeheading and pingheading. These all use text formatting commands to place the title text in the correct location above each column.

The box that contains the player's information is displayed by the playerstatswindow item, which draws a colored outlined box. The scrollbarwindow item draws a vertical line 16 pixels from the right side of the player info box to delimit the scroll bar area from the rest of the box. The columns use items that draw a colored outlined box that covers the area of each column. These items are skillcolumnWindow, statuscolumnWindow, namecolumnWindow, scorecolumnWindow, timecolumnWindow and pingcolumnWindow.

The actual information about the players is displayed using the playerlist item. This is a List box item that uses the feeder FEEDER_SCOREBOARD command to obtain it's data. The columns command is used to format the 7 columns of information provided by this feeder so it fits into the columns we created in the box drawn by the playerstatswindow item. You will notice that the first two columns of information from the feeder are drawn in the same area. This is done for nonteam games since the second column of information is the team status, which, in this case, will always be blank.

Underneath the player information box is another box displayed by the lowerwindow item, which draws a colored, outlined area. The gameinfowindowbar item draws a vertical line to break this box into two sections. The left section displays information about the current game, while the right section shows the player's medals.

The gametype item uses the ownerdraw CG_GAME_TYPE command to display the type of game being played. It uses the text formatting commands in the item to place the text in the correct location. The fraglimit item is an Editfield item displaying the contents of the fraglimit cvar. This shows the frag limit for the game. There is an ownerdraw command that will display the same information but, because of the funny way it positions the text, this method is must cleaner to implement. The playerscore item uses the ownerdraw CG_PLAYER_SCORE command to display the player's game score. It uses the text formatting commands in the item to place the text in the correct location. The scrollmsg item simply display a text message remining you that you can use the scroll keys to scroll the player information list to see all the playes in the game.

The four items that display the information about the medals the player may have are all constructed in the same fashion. The items are medal_accuracy, medal_excellent, medal_gauntlet and medal_impressive. They all use the background command to display a graphic representing their particular medal (the size of the graphic is set by the window area of the item, 32x32 in this case) and then use an ownerdraw command to display the actual medal value or percentage. The text size is controlled by the textscale command in the item. The color of the text is set by the forecolor command, which in this case, makes the text slightly transparent.

 

Part III : Team Scoreboard

 

[Part I] [Part II] [Part III]

 

Return to Home Page