Guides

SuperHUD

Since the release of CPMA 1.34 we have had extremely configurable HUDs. This document explains some of the Client HUD settings for CPMA.

Note: cvars such as cg_drawfps, cg_drawtimer plus many others have been removed and their functions moved to the custom hud.

Creating a HUD .cfg

  • ALL hud configs go in Quake3/cpma/hud. CPMA's sample HUDs 1-7 are also in that directory.
  • You can select a config using \ch_file hud where 'hud' is the file you would like to use (without .cfg).
  • You do NOT exec hud.
  • Use \reloadHUD to reload your HUD if you have changed it. Must also be used after ch_file change.
  • The default HUD is in the PK3: if you want to customise it, pull it out of there with the unzip utility of your choice, RENAME it, and put the copy in cpma/hud/. Remember to point ch_file at the new version.
  • The default HUD references (nearly) everything that can be drawn. Hud7 has nice examples of decoration use.

Syntax

The syntax for CPMA's SuperHud is fairly easy to comprehend, and supports both multi-line and single-line arguments.

ELEMENT
{
    ELEMENT_COMMAND VALUE
    ELEMENT_COMMAND VALUE
}

ELEMENT { ELEMENT_COMMAND VALUE; ELEMENT_COMMAND VALUE; }

You can comment using # but // cannot be used.
Some Element Commands have optional "," separators.

Elements

Each piece of the HUD is called an ELEMENT. Elements are sorted z-layer-wise alphabetically.

The first element in the hudfile MUST be !DEFAULT, and every other element inherits from that default: this gives you an easy way to change fonts/colors/etc for a whole bunch of elements at once.

!DEFAULT can be reused later in the document affecting every following element but it will not overwrite the parameters set by previous !DEFAULT(s). It is advisable to place Team1-8 and Chat1-8 at the bottom of your hud config so that !DEFAULTs can be used without interfering with other elements.

Element Description
PreDecorate and PostDecorate Elements that can be used to draw separator bars etc. Limit 64 total.
AmmoMessage Low ammo/Out of ammo. The audio feedback "click" can be toggled using cg_ammoWarning.
AttackerIcon Who attacked you last.
AttackerName Who attacked you last.
Chat1-8 Chat area. If you want the order of the messages reversed then reverse the Y coordinates.
Console Replacement for id's console. Use with con_notifyTime -1.
FlagStatus_NME Status of enemy flag. To get old RED/BLUE, use color T and color E, plus bgcolor. Check hud/old.cfg.
FlagStatus_OWN Status of your flag. To get old RED/BLUE, use color T and color E, plus bgcolor. Check hud/old.cfg.
FollowMessage Following <Player>.
FPS FPS (Frames Per Second) counter.
FragMessage You fragged <Player>.
GameTime Game Clock.
GameType Game Type - warmup only. Cannot be omitted. To hide place at off-screen x,y coordinates or set alpha 0.
ItemPickup Text string of whatever item you pick up.
ItemPickupIcon Icon of whatever item you pick up.
KeyDown_Back Shown when the +back key is pressed. See ch_drawKeys.
KeyDown_Crouch Shown when the +movedown key is pressed. See ch_drawKeys.
KeyDown_Forward Shown when the +forward key is pressed. See ch_drawKeys.
KeyDown_Jump Shown when the +moveup key is presse. See ch_drawKeys.
KeyDown_Left Shown when the +moveleft key is pressed. See ch_drawKeys.
KeyDown_Right Shown when the +moveright key is pressed. See ch_drawKeys.
KeyUp_Back Shown when the +back key is released. See ch_drawKeys.
KeyUp_Crouch Shown when the +movedown key is released. See ch_drawKeys.
KeyUp_Forward Shown when the +forward key is released. See ch_drawKeys.
KeyUp_Jump Shown when the +moveup key is released. See ch_drawKeys.
KeyUp_Left Shown when the +moveleft key is released. See ch_drawKeys.
KeyUp_Right Shown when the +moveright key is released. See ch_drawKeys.
MultiView Only visible when following a player "full-screen" with multi-view enabled.
NetGraph Lagometer.
NetGraphPing Ping.
PlayerSpeed Units Per Second.
PowerUp1Icon to PowerUp4Icon Powerup Icons. PowerUp1_Icon is also used for the O/D indicator in CTFS - and also for FLAG.
PowerUp1Time to PowerUp4Time Powerup Time remaining.
RankMessage Placed 1st with 30 frags.
Score_Limit Frag/Cap/Round limit - if set. Cannot be omitted. To hide place at off-screen x,y coordinates or set alpha 0.
Score_NME Enemy score. Cannot be omitted. To hide place at off-screen x,y coordinates or set alpha 0. To get old RED/BLUE use color T and color E, plus bgcolor. Check hud/old.cfg.
Score_OWN Your score. Cannot be omitted. To hide place at off-screen x,y coordinates or set alpha 0. To get old RED/BLUE use color T and color E, plus bgcolor. Check hud/old.cfg.
SpecMessage SPECTATOR, FRAGGED (in CA/CTFS/FT.)
StatusBar_ArmorBar Armor level in bar form.
StatusBar_ArmorCount Armor level in number form.
StatusBar_ArmorIcon Type of armor - essential in CPM but irrelevant in VQ3.
StatusBar_AmmoBar Ammo level in bar form.
StatusBar_AmmoCount Ammo level in number form.
StatusBar_AmmoIcon Current weapon ammo icon.
StatusBar_HealthBar Health level in bar form.
StatusBar_HealthCount Health level in number form.
StatusBar_HealthIcon Defaults to Mynx icon but can be any model, image or shader found in pk3s (provided that the pk3 is on the pure server you join).
TargetName Current target's playername - see cg_drawCrosshairNames.
TargetStatus Current friendly target's health/armor level - see cg_drawCrosshairNames.
TeamCount_NME Players alive on enemy team (CA/CTFS/FT).
TeamCount_OWN Players alive on your team (CA/CTFS/FT).
TeamIcon_NME Defaults to Sarge icon but can be any model, image or shader found in pk3s (provided that the pk3 is on the pure server you join).
TeamIcon_OWN Defaults to Mynx icon but can be any model, image or shader found in pk3s (provided that the pk3 is on the pure server you join).
Team1-8 Teamoverlay.
VoteMessageArena Multiarena, ra3maps.
VoteMessageWorld Normal votes.
WarmupInfo 10sec countdown, Waiting for players, etc. Cannot be omitted. To hide place at off-screen x,y coordinates or set alpha 0.
WeaponList The WeaponList has to get a little funky to be able to handle all the legacyhud tricks: W and H are the size of EACH weapon, not the total. For the horizontal weaponlist (textalign C) X is the point to center around. Use FILL to show ammo for weapons you do not have, useful for TDM. Weaponlist wraps at the bottom of the screen so you can sneak a multi-column one in.

Colors

CPMA HUD uses r g b a, which is red green blue alpha. Each channel can have values from 0-1.

Color 1 1 1 1 is white, full alpha
Color 0 0 0 0.5 is black, half transparent
Color 0.25 0.25 1 0.75 is blue, somewhat transparent

Note that colors set in SuperHUD do not override colors set elsewhere.
For example if your nick or name is "^3hello" it will be yellow regardless.

Special Colors

color T and color E for elements to use red/blue according to your current team.
Useful for flag modes, but not necessesary for tdm/1v1. Set bgcolor for these, even for images. See hud/old.cfg.

Element Commands

The commands you can use within an element are:

Command Values Description
ANGLES <pitch> <yaw> <roll> [+pan / -rotate] Alters the display of MODEL.
Note that most Q3 models do not work properly if r_vertexlight is on.
BGCOLOR r g b a Sets the background color for the element The element must have a width and height.
COLOR r g b a Sets the foreground color for the element.
DOUBLEBAR Makes bars two lines. Obviously only works on BAR elements (StatusBar_ArmorBar etc). Check out hud7 for examples.
Note: Gets a little funky if RECT Height is set below 6 as the space between the two bars is 4 pixels and each bar requires 1 pixel (4+1+1=6).
FADE r g b a If the element has a TIME, its text will fade from COLOR to this linearly over TIME milliseconds.
FILL If the element has a background color, this fills the area it occupies with that color. The element must have a width and height.
FONT name Selects one of a few standard fonts:
CPMA - Bitstream Vera Bold, which is a high-resolution font best suited to 1024x768 and up - or large font-size on low-resolution
ID - standard Q3 font - good for small font-size and/or low-resolution
IDBLOCK - only supports numbers, NOT letters
THREEWAVE - which is an outlined copy of the id font
SANSMAN - Digital Graphics Labs' "Enter Sansman".
FONTSIZE pointsize or xsize ysize The CPMA font is correctly aspect-adjusted already, and generally looks best if you just specify a pointsize. The other two fonts are square, and generally look much better if you specify distinct x and y sizes, with y being 25-50% larger than x. Element texts can be mirrored using negative x y. Note this is an unintended and unsupported "hack", so might be a bit buggy.
IMAGE pathname Display the image specified. You can use ANY image or shader found in pk3s. Mostly useful for displaying team/enemy model icons in CA/CTFS/FT.
MODEL model Can be any model in the game. Note that most Q3 models do not work properly if r_vertexlight is on.
MONOSPACE By default, all HUD fonts are proportionally spaced, meaning that an "i" takes up less room than an "m". Monospacing forces every character to take up the same amount of space. It's very useful for the team overlay, as it keeps everyone's health and armor in the same columns, but generally looks worse than proportional spacing on everything else, especially chat. It also takes up more room overall.
OFFSET x y z Offset MODEL along x y z axis.
RECT x y w h Sets the position and size of the element. Note that text is NOT "clipped" to this rectangle. Elements can be mirrored using negative w h. Note this is an unintended and unsupported "hack", so might be a bit buggy.
TEXT string Mostly useful for decorations. Requires RECT.
TEXTALIGN l / c / r Justify the text either Left, Centered, or Right within RECT.
TEXTSTYLE flags Currently, only one flag is supported: "1", for dropshadowed text.
TIME milliseconds How long the element will be displayed for if it doesn't update again. Generally used for item pickups, frag messages, chat, etc.
VISFLAGS flags 1 - Enable when following a player "full-screen".
2 - Enable in free-float camera view
4 - Enable in coach view.

These cvars do not directly influence the SuperHud but are still related to the HUD in some way.

CVar Value Default Description
cg_customLoc 0/1 1 Use custom locations for a map if possible.
Loc files are locs/map.cfg, and must have a "v2" header.
Can only replace existing locations.
cg_drawRewards 0/1 1 Toggle display of reward icons and the accompanying sounds.
cg_teamChatsOnly 0/1 0 Controls what text reaches the HUD Chat elements if set, non-team text still shows up in the console area.
ch_3waveFont 0/1 1 Toggle use of the Threewave font (does not affect SuperHud settings).
ch_drawWarmup 0/1 0 Toggle display of arena settings before a game starts.
ch_drawWeaponSelect 0/1 0 Toggle id standard weapon selection.
ch_recordMessage 0/1 1 Gets rid of the sodding "recording blahblah" message. Must be set before demo record start.
ch_selfOnTeamOverlay 0/1 1 Toggle your own information showing in the team overlay.
ch_shortNames 0/1 0 Toggle use of nick - set a short name to use for team chat/overlay Limited to 5 visible characters, but allows colors Useful to have your nick shown instead of [longclantag] in team chat/overlay
Note: nick is only used for team chat/overlay. name is still used for anything else.
ch_wstatsTime seconds 10 How long the auto-wstats window stays up at the end of a game.
ch_drawKeys bitmask 0 Add up the numbers corresponding to the options you want enabled
1 - When playing
2 - When following another player
4 - During demo playback (won't work with pre-1.50 demos)
con_notifyTime seconds or -1 3 Uses the CPMA "Console" hud element instead of id's when -1. Doesn't affect the console buffer, just the text in the top left.
mvw_DM x y w h Picture in Picture window for DM games.
mvwTDM1-9 x y w h Controls teamplay Multi View layout. Format is the same as mvwDM, default no child windows.

Example for mvwTDM:

seta mvw_TDM1 "480 65 160 120"
seta mvw_TDM2 "480 190 160 120"
seta mvw_TDM3 "480 315 160 120"

Crosshair Cvars

CVar Value Default Description
cg_crosshairHealth 0-1 0 Red crosshair when low on health
Must be 0 for ch_crosshairColor to work.
cg_crosshairsize value 24 Size of crosshair.
cg_drawcrosshair 0-9 8 Switch between different crosshairs.
ch_crosshairAlpha 0.0-1.0 0.8 Controls the transparency of the crosshair.
cg_drawCrosshairNames 0-2 1 Toggles TargetName and TargetStatus.
0 - Off
1 - On
2 - On for teammates only.
ch_crosshairColor color y CPMAColors Important note: cg_crosshairHealth overrides this function, turn it off to use colored crosshairs.
ch_crosshairPulse 0-1 0 Controls crosshair size changes when picking up items.
ch_crosshairText string "" Use any text sting as crosshair.

Known Issues

  • Color fails on elements with color codes embedded in their strings (StatusBar_HealthCount, StatusBar_ArmorCount, NetGraphPing, etc).
  • Alpha fails on some elements containing images (StatusBar_AmmoIcon, StatusBar_ArmorIcon, etc).
  • Fade fails on some elements containing images without alpha channels (ItemPickupIcon, etc).
  • If a !DEFAULT sets MONOSPACE, FILL or DOUBLEBAR, there is no method to remove it again (so don't do it unless it's at the end of the file).
  • color T and color E act funny when in non-teamplay modes such as 1v1.
  • FILL plus bgcolor when used on elements that disappear without having TIME makes bgcolor remain indefinitely.
  • Not implemented: cg_drawRewards element not included in SuperHUD.