Warfork HUDs are plain-text scripts using a draw command language. They live in:

HUD scripts live in [assets/data0_21/huds/](https://github.com/TeamForbiddenLLC/warfork-qfusion/tree/master/assets/data0_21/huds)

Default HUDs

FileDescription
adem.hudCompetitive HUD with strafe indicator
classic.hudClassic Warsow-style layout
default.hudStandard HUD
spec.hudSpectator HUD

Switch HUD in console:

cg_clientHUD "adem"

Set to an empty string to use the engine default.

Draw Commands

CommandDescription
setCursor x, ySet absolute draw position
moveCursor dx, dyMove relative to current position
setSize w, hSet draw dimensions
setAlign horizontal, verticalAlignment: #LEFT #CENTER #RIGHT / #TOP #MIDDLE #BOTTOM
setColor r, g, b, aSet draw color (0.0 to 1.0 per channel)
setScale modeScaling: #DEFAULTSCALE, #SCALEBYWIDTH, #SCALEBYHEIGHT
drawPicByName pathDraw a full texture
drawSubPicByName path s t s2 t2Draw a sub-region of a texture
if <condition> / endifConditional block

HUD Variables

Variables are prefixed with %. They are read-only values injected by the engine at draw time.

VariableDescription
%HEALTHCurrent health points
%ARMORCurrent armor value
%SPEEDCurrent speed in units per second (UPS)
%STRAFEANGLEStrafe angle used by the strafe indicator
%ACCELERATIONCurrent acceleration (positive = gaining speed, negative = losing)
%DIFF_ANGLEDifference between movement direction and facing direction
%RACE1 when in race mode
%MATCH_STATECurrent match state constant
%PMOVE_TYPECurrent movement type constant
%SHOW_STRAFE1 when strafe HUD is enabled via cg_strafeHUD

Strafe HUD

The strafe indicator (cg_strafeHUD 1) is defined in inc/strafe.hud and included by adem.hud. It renders only when all three conditions are true:

  • %SHOW_STRAFE != 0
  • In race mode or in warmup: %RACE || %MATCH_STATE == MATCH_STATE_WARMUP
  • Movement type is normal: %PMOVE_TYPE == PMOVE_TYPE_NORMAL

Triangle size is computed as 0.03 * 4500 - %STRAFEANGLE. A larger strafe angle shrinks the visual target area.

Bar position shifts horizontally based on %DIFF_ANGLE: the angle between your movement direction and where you are facing.

Color logic:

ColorConditionMeaning
WhiteDefaultNeutral
Red%ACCELERATION < -5000Losing speed
Green%ACCELERATION > 0.8Gaining speed: correct strafe

Include System

HUDs can include sub-scripts:

#include "inc/strafe.hud"
#include "inc/clock.hud"

The default HUDs use an inc/ subdirectory with modular components: strafe.hud, clock.hud, minimap.hud, powerups.hud, fps.hud.

Installing a Custom HUD

  1. Place myhud.hud in basewf/huds/
  2. Set cg_clientHUD "myhud" in console or your autoexec config
  3. The HUD loads on the next map load or respawn

Custom HUDs can also be packaged inside a .pk3 file under the huds/ path.

See Also

  • Console: full cvar reference including cg_clientHUD, cg_strafeHUD
  • Movement: strafe mechanics context for interpreting the strafe indicator