How to: Customize your own HUD - ET-Legacy-Competitive/faq GitHub Wiki

Besides the default HUD options and few settings for HUD elements ETLegacy also provides a way to change the location of all the HUD elements. Just like your normal config this is done through an extra file that can be loaded called hud.dat.

Step 1

Create a file called hud.dat in your legacy mod folder. e.g. C:\Users\PCUSER\Documents\ETLegacy\legacy

Step 2

Paste the text below into the file you just created hud.dat.

hudDef {
	hud {
		hudnumber 5 //          x       y       w       h       s       v
		compass			44	393	84	84	0	1
		staminabar		4	388	12	72	0	1
		breathbar		4	388	12	72	0	1
		healthbar		604	388	12	72	0	1
		weaponchargebar		624	388	12	72	0	1
		healthtext		580	415	0	0	0	1
		xptext			48	476	0	0	0	1
		ranktext		62	464	0	0	0	1
		statsdisplay		24	385	0	0	1	1
		weaponicon		538	424	60	32	0	1
		weaponammo		598	470	0	0	0	1
		fireteam		400	10	100	100	0	1
		popupmessages		4	100	72	72	0	1
		powerups		600	344	36	36	0	1
		objectives		8	344	36	36	0	1
		hudhead			44	388	62	80	0	0
		cursorhints		296	260	48	48	0	1
		weaponstability		50	208	10	64	0	1
		livesleft		0	0	0	0	0	1
		reinforcement		570	390	0	0	0	1
		roundtimer		570	390	0	0	0	1
		spawntimer		570	390	0	0	0	1
		localtime		570	400	0	0	0	1
		votetext		8	224	0.22	0.22	1	1
		spectatortext		8	188	0.22	0.22	1	1
		limbotext		8	164	0.22	0.22	1	1
		followtext		8	164	0.22	0.22	1	1
		demotext		10	9	0.22	0.22	1	1
	}
}

Let's go through what the text means step by step. hudDef { is just a definition to tell the game that it knows it is reading a HUD definition. hud { signifies the start of a HUD configuration. You can have multiple. As you can see the line hudnumber 5 defines which number is related to this specific configuration. This number corresponds with the value of cvar cg_althud. From here all text is a HUD element. The numbers after it mean the following:

  • X: Amount of pixels from left to right on the screen. Depends on your resolution and can be relative.
  • Y: Amount of pixels from top to bottom on the screen. Depends on your resolution and can be relative.
  • Width: Amount of pixels in width.
  • Height: Amount of pixels in height.
  • Style: Presents the HUD element in a other style if available.
  • Visible: Boolean value to toggle visibility. 0 = Hidden, 1 = Shown

Step 3

Start the game and type in console the following commands.
readhuds
cg_althud x where 'x' is the hud number you set in the hud.dat file.
cg_althudflags x where x depends if you want to move things like fireteam. 5 or above to have it in top right corner. It also influences other elements if they use the numbers from hudfile or hardcoded values.

Optional - Changing size and color

It is now possible to change the size and color from most hud elements. To do this you can use the existing hud file and add the numbers for scale and color on each row. This is an example:

hudDef {
	hud {
		hudnumber 5 //          x       y       w       h       s       v	sc	r	g	b	a
		compass			44	393	84	84	0	1	0.19	1	1	1	1
		staminabar		4	388	12	72	0	1	0.19	1	1	1	1
		breathbar		4	388	12	72	0	1	0.19	1	1	1	1
		healthbar		604	388	12	72	0	1	0.19	1	1	1	1
		weaponchargebar		624	388	12	72	0	1	0.19	1	1	1	1
		healthtext		580	415	0	0	0	1	0.25	1	1	1	1
		xptext			48	476	0	0	0	1	0.25	1	1	1	1
		ranktext		62	464	0	0	0	1	0.20	1	1	1	1
		statsdisplay		24	385	0	0	1	1	0.25	1	1	1	1
		weaponicon		538	424	60	32	0	1	0.19	1	1	1	1
		weaponammo		598	470	0	0	0	1	0.25	1	1	1	1
		fireteam		400	10	100	100	0	1	0.19	1	1	1	1
		popupmessages		4	100	72	72	0	1	0.19	1	1	1	1
		powerups		600	344	36	36	0	1	0.19	1	1	1	1
		objectives		8	344	36	36	0	1	0.19	1	1	1	1
		hudhead			44	388	62	80	0	0	0.19	1	1	1	1
		cursorhints		296	260	48	48	0	1	0.19	1	1	1	1
		weaponstability		50	208	10	64	0	1	0.19	1	1	1	1
		livesleft		0	0	0	0	0	1	0.19	1	1	1	1
		reinforcement		570	390	0	0	0	1	0.19	0	0.5	1	1
		roundtimer		570	390	0	0	0	1	0.19	1	1	1	1
		spawntimer		570	390	0	0	0	1	0.19	1	0	0	1
		localtime		570	400	0	0	0	1	0.19	0.6	0.6	0.6	1
		votetext		8	224	0.22	0.22	1	1	0.19	1	1	1	1
		spectatortext		8	188	0.22	0.22	1	1	0.19	1	1	1	1
		limbotext		8	164	0.22	0.22	1	1	0.19	1	1	1	1
		followtext		8	164	0.22	0.22	1	1	0.19	1	1	1	1
		demotext		10	9	0.22	0.22	1	1	0.22	1	0	0	1
	}
}

As you can see there are 5 new numbers added behind the numbers that were already there. The new numbers represent the following:

  • sc = Scale = The size of text / icons. A floating punt number that can go above 1. e.g. 6.66.
  • r,g,b = Red/Blue/Green = A floating point number between 0 and 1 that represents how much of a color is used. You can use the following sites to find out the numbers for the color you want.
  • a = alpha = The opacity of the text. 0.1 almost invisible, 1 very clear.

https://corecoding.com/utilities/rgb-or-hex-to-float.php
http://etconfig.net/et-color-codes/et-color-codes/

Just put the html color code in and you will get the rgb values in floating point values.