// Shows the text inside a black transparent background.
// Note: the background may not draw properly when initialized as "0", start the map with "1" to render properly.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_background "0"
// Makes the text play a beep sound while blinking.
// 0 = OFF, 1 = ON. Note: the blink cvar must be "1" to play the beep sound.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_beep "0"
// Makes the text blink from white to red.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_blink "0"
// Makes the text blink from white to red while a tank is alive.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_blink_tank "1"
// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud1_height "0.026"
// Which team should see the text.
// 0 = ALL, 1 = SURVIVOR, 2 = INFECTED.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud1_team "0"
// The text you want to display in the HUD.
// Note: When cvar is empty "", plugin will use the predefined HUD text set in the code, check GetHUD*_Text functions.
// -
// Default: "HUD 1 TEXT"
l4d2_scripted_hud_hud1_text "HUD 1 TEXT"
// Aligns the text horizontally.
// 1 = LEFT, 2 = CENTER, 3 = RIGHT.
// -
// Default: "1"
// Minimum: "1.000000"
// Maximum: "3.000000"
l4d2_scripted_hud_hud1_text_align "1"
// Makes the text visible.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_visible "1"
// Text area Width.
// -
// Default: "1.5"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud1_width "1.5"
// X (horizontal) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.02"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_x "0.02"
// Animated X (horizontal) direction that the text will move.
// 0 = Right to Left, 1 = Left to Right.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_x_direction "0"
// Animated X (horizontal) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_x_max "1.0"
// Animated X (horizontal) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_x_min "0.0"
// Animated X (horizontal) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud1_x_speed "0.0"
// Y (vertical) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.015"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_y "0.015"
// Animated Y (vertical) direction that the text will move.
// 0 = Top to Bottom, 1 = Bottom to Top.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_y_direction "0"
// Animated Y (vertical) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_y_max "1.0"
// Animated Y (vertical) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_y_min "0.0"
// Animated Y (vertical) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud1_y_speed "0.0"
// Shows the text inside a black transparent background.
// Note: the background may not draw properly when initialized as "0", start the map with "1" to render properly.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_background "0"
// Makes the text play a beep sound while blinking.
// 0 = OFF, 1 = ON. Note: the blink cvar must be "1" to play the beep sound.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_beep "0"
// Makes the text blink from white to red.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_blink "0"
// Makes the text blink from white to red while a tank is alive.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_blink_tank "1"
// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud2_height "0.026"
// Which team should see the text.
// 0 = ALL, 1 = SURVIVOR, 2 = INFECTED.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud2_team "0"
// The text you want to display in the HUD.
// Note: When cvar is empty "", plugin will use the predefined HUD text set in the code, check GetHUD*_Text functions.
// -
// Default: ""
l4d2_scripted_hud_hud2_text ""
// Aligns the text horizontally.
// 1 = LEFT, 2 = CENTER, 3 = RIGHT.
// -
// Default: "1"
// Minimum: "1.000000"
// Maximum: "3.000000"
l4d2_scripted_hud_hud2_text_align "1"
// Makes the text visible.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_visible "1"
// Text area Width.
// -
// Default: "1.5"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud2_width "1.5"
// X (horizontal) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.75"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_x "0.75"
// Animated X (horizontal) direction that the text will move.
// 0 = Left to Right, 1 = Right to Left.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_x_direction "0"
// Animated X (horizontal) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_x_max "1.0"
// Animated X (horizontal) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_x_min "0.0"
// Animated X (horizontal) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud2_x_speed "0.0"
// Y (vertical) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.015"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_y "0.015"
// Animated Y (vertical) direction that the text will move.
// 0 = Top to Bottom, 1 = Bottom to Top.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_y_direction "0"
// Animated Y (vertical) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_y_max "1.0"
// Animated Y (vertical) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_y_min "0.0"
// Animated Y (vertical) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud2_y_speed "0.0"
// Shows the text inside a black transparent background.
// Note: the background may not draw properly when initialized as "0", start the map with "1" to render properly.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_background "0"
// Makes the text play a beep sound while blinking.
// 0 = OFF, 1 = ON. Note: the blink cvar must be "1" to play the beep sound.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_beep "0"
// Makes the text blink from white to red.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_blink "0"
// Makes the text blink from white to red while a tank is alive.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_blink_tank "1"
// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud3_height "0.026"
// Which team should see the text.
// 0 = ALL, 1 = SURVIVOR, 2 = INFECTED.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud3_team "0"
// The text you want to display in the HUD.
// Note: When cvar is empty "", plugin will use the predefined HUD text set in the code, check GetHUD*_Text functions.
// -
// Default: ""
l4d2_scripted_hud_hud3_text ""
// Aligns the text horizontally.
// 1 = LEFT, 2 = CENTER, 3 = RIGHT.
// -
// Default: "1"
// Minimum: "1.000000"
// Maximum: "3.000000"
l4d2_scripted_hud_hud3_text_align "1"
// Makes the text visible.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_visible "1"
// Text area Width.
// -
// Default: "1.5"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud3_width "1.5"
// X (horizontal) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.02"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_x "0.02"
// Animated X (horizontal) direction that the text will move.
// 0 = Left to Right, 1 = Right to Left.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_x_direction "0"
// Animated X (horizontal) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_x_max "1.0"
// Animated X (horizontal) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_x_min "0.0"
// Animated X (horizontal) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud3_x_speed "0.0"
// Y (vertical) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.15"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_y "0.15"
// Animated Y (vertical) direction that the text will move.
// 0 = Top to Bottom, 1 = Bottom to Top.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_y_direction "0"
// Animated Y (vertical) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_y_max "1.0"
// Animated Y (vertical) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_y_min "0.0"
// Animated Y (vertical) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud3_y_speed "0.0"
// Shows the text inside a black transparent background.
// Note: the background may not draw properly when initialized as "0", start the map with "1" to render properly.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_background "0"
// Makes the text play a beep sound while blinking.
// 0 = OFF, 1 = ON. Note: the blink cvar must be "1" to play the beep sound.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_beep "0"
// Makes the text blink from white to red.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_blink "0"
// Makes the text blink from white to red while a tank is alive.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_blink_tank "1"
// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud4_height "0.026"
// Which team should see the text.
// 0 = ALL, 1 = SURVIVOR, 2 = INFECTED.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud4_team "0"
// The text you want to display in the HUD.
// Note: When cvar is empty "", plugin will use the predefined HUD text set in the code, check GetHUD*_Text functions.
// -
// Default: ""
l4d2_scripted_hud_hud4_text ""
// Aligns the text horizontally.
// 1 = LEFT, 2 = CENTER, 3 = RIGHT.
// -
// Default: "1"
// Minimum: "1.000000"
// Maximum: "3.000000"
l4d2_scripted_hud_hud4_text_align "1"
// Makes the text visible.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_visible "1"
// Text area Width.
// -
// Default: "1.5"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud4_width "1.5"
// X (horizontal) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.75"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_x "0.75"
// Animated X (horizontal) direction that the text will move.
// 0 = Left to Right, 1 = Right to Left.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_x_direction "0"
// Animated X (horizontal) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_x_max "1.0"
// Animated X (horizontal) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_x_min "0.0"
// Animated X (horizontal) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud4_x_speed "0.0"
// Y (vertical) position of the text.
// Note: setting it to less than 0.0 may cut/hide the text at screen.
// -
// Default: "0.35"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_y "0.35"
// Animated Y (vertical) direction that the text will move.
// 0 = Top to Bottom, 1 = Bottom to Top.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_y_direction "0"
// Animated Y (vertical) maximum position that the HUD can reach.
// -
// Default: "1.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_y_max "1.0"
// Animated Y (vertical) minimum position that the HUD can reach.
// -
// Default: "0.0"
// Minimum: "-1.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_y_min "0.0"
// Animated Y (vertical) movement speed of the text.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d2_scripted_hud_hud4_y_speed "0.0"
// Interval in seconds to update the HUD.
// -
// Default: "0.1"
// Minimum: "0.100000"
l4d2_scripted_hud_update_interval "0.1"
Admin Commands
sm_l4d2_scripted_hud_reload_data => Reload the HUD texts set in the data file. (z flag required)
sm_print_cvars_l4d2_scripted_hud => Print the plugin related cvars and their respective values to the console. (z flag required)
Change Log
Spoiler
1.0.2 (01-May-2021)
- Added support to special characters in static HUD texts through a data file. (thanks "Voevoda" for requesting)
- Added a required file at data folder.
1.0.1 (13-March-2021)
- Added cvars to make the next animated. (thanks "Source" for requesting)
- Increased some cvars min/max bounds to fit more screen resolutions.
1.0.0 (10-March-2021)
- Initial release.
Known Issues
This plugin conflicts with the "Admin System" addon by Rayman1103 (GameMaps / Steam Workshop)
This plugin conflicts with any plugin that changes the <gamemode>.nut file. (check Related Plugins section)
This plugin conflicts with any addon or map that changes the <gamemode>.nut file. (check it by opening the .vpk and going to the "scripts\vscripts\" folder)
This plugin conflicts with any mutation that changes the <gamemode>.nut file. (e.g: holdout)
If your HUD is showing and hiding very fast probably you have some <gamemode>.nut file conflicting with the plugin.
Notes
If you need set special characters in a static hud text slot, instead using the cvar for it, use the file located at the data folder (available in the attachments), because cvars don't read special characters from .cfg files.
There is no multi-language support, cause the text shown is not per client, the text will be the same for everyone.
You MUST have a file with your gamemode in the "\left4dead2\scripts\vscripts\" folder, if the folder doesn't exist, create it. (e.g. left4dead/scripts/vscripts/coop.nut)
The <gamemode>.nut file must exist because the HUD seems to initialize only during the "scripted mode" phase. (I don't have much info about that)
The position/width/height of the HUD may vary depending on the clientscreen resolution. (e.g. for 800x640 the best height value is 0.058, while for 1280x720 is 0.035, while for 1920x1080 is 0.026)
Since there is no option to align vertically, setting the HUD height to high values can make the text go down.
The limit of a HUD text is up to 127 characters.
The total # of avaliable HUDs are 15, but I was unable to set more than 4 (using SM + GameRules_SetPropString) because of a currently sourcemod limitation. (issue already open here)
Since I wasn't able to pass the HUD id to set the text, I fill it with spaces, so depending on the resolution or the HUD width it may show a "..." at the end. To hide this I increased the width size of all 4 HUDs.
Setting the background cvar from "0" to "1" in-game doesn't work, you have to restart the map with the cvar (on l4d2_scripted_hud.cfg) already initialized as "1" otherwise, the game won't render it properly.
Isn't possible to change the background or text color/alpha.
Predefined HUDs are not used when its relative "*_text" cvar has a value set.
The HUD4 text was made to show up who is speaking on the microphone, but since it uses an external extension (for SM1.10), the code is commented.
To Do
Try to fix the background not rendering properly when changing from "0" to "1" in-game.
Add support to the other HUDs (5-15). (depends on this SM issue)
Support timers.
Make the voice hook extension optional while downloading the plugin.
Find a way to don't require a <gamemode>.nut file.
Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.
IMPORTANT: <gamemode>.nut File
You MUST have a file with your gamemode in the "\left4dead2\scripts\vscripts\" folder, if the folder doesn't exist, create it. (e.g. scripts/vscripts/coop.nut)
Your <gamemode>.nut file content MUST have the following line otherwise, the plugin won't work:
PHP Code:
g_ModeScript
Code snippet inside the "l4d2_scripted_hud_rename.nut" file.
Installation
Put the "l4d2_scripted_hud.cfg" file (click Get Plugin) in your "\addons\sourcemod\data\" folder.
Put the "l4d2_scripted_hud.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
Download the "l4d2_scripted_hud.zip" file and extract in your "\left4dead2\scripts\vscripts\" folder, if the folder doesn't exist, create it. (don't forget to backup your <gamemode>.nut file if you already have one, e.g. coop.nut)
Rename the "l4d2_scripted_hud_rename.nut" file to your gamemode (<gamemode>.nut) and restart the map. (you can find your gamemode value by typing "!cvar mp_gamemode" in chat, e.g. if you are hosting a coop server the file should me renamed as "coop.nut")
Since people often miss this last step (even being warned multiple times in the thread),
Ensure that you renamed the l4d2_scripted_hud_rename.nut file to your gamemode. (<gamemode>.nut)
If you run a coop server. Rename it to "coop.nut"
If you run a versus server. Rename it to "versus.nut"
If you run a survival server. Rename it to "survival.nut"
If you run a scavenge server. Rename it as "scavenge.nut"
If you run some mutation gamemode. Rename it to "<mutation>.nut"
1.0.1 (13-March-2021)
- Added cvars to make the next animated. (thanks "Source" for requesting)
- Increased some cvars min/max bounds to fit more screen resolutions.