Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSS[L4D2] Scripted HUD [v1.0.0 | 10-March-2021]


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
L4D2 ONLY

Description

Display text for up to 4 scripted HUD slots on the screen.

You can check more detailed information at L4D2 EMS/Appendix: HUD.

This plugin is not easy to install and has too many (unusual) conflicts.

Probably will have a lot of users unable to make it work.

I hope that it can be used as an example to improve it by others and create new things on L4D2.

You can help it to expand up to 15 HUDs by contributing somehow on this SM issue. (unless there is some other way to do it)

Features
  • Allow setting HUD text.
  • Allow setting the HUD horizontal text alignment (left/center/right).
  • Predefined HUD texts. (HUD2 = Survivors Name + HP, HUD3 = Tanks Name + HP, HUD4 [disabled by default] = Microphone Speaking)
  • Allow setting the HUD position (x,y).
  • Allow setting the HUD width and height.
  • Allow setting the HUD to blink from white to red while a tank is alive.
  • Allow setting the HUD to blink from white to red.
  • Allow setting the HUD to emit a beep sound. (only while blinking)
  • Allow setting the HUD to have a black transparent background.
  • Allow show/hide the HUD.
  • Allow setting which teams (all/survivor/infected) should see the HUD.

Preview

68747470733a2f2f692e696d6775722e636f6d2f

Cvars

A configuration file named "l4d2_scripted_hud.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

PHP Code:

// Enables/Disables the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_enable "1"

// 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"

// Overwrite the HUD flag.
// For debug purposes only.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "32767.000000"
l4d2_scripted_hud_hud1_flag_debug "0"

// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "1.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.
// -
// 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.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_width "1.0"

// X position of the text.
// -
// Default: "0.02"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_x "0.02"

// Y position of the text.
// -
// Default: "0.015"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud1_y "0.015"

// 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"

// Overwrite the HUD flag.
// For debug purposes only.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "32767.000000"
l4d2_scripted_hud_hud2_flag_debug "0"

// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "1.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.
// -
// 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.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_width "1.0"

// X position of the text.
// -
// Default: "0.75"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_x "0.75"

// Y position of the text.
// -
// Default: "0.015"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud2_y "0.015"

// 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"

// Overwrite the HUD flag.
// For debug purposes only.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "32767.000000"
l4d2_scripted_hud_hud3_flag_debug "0"

// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "1.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.
// -
// 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.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_width "1.0"

// X position of the text.
// -
// Default: "0.02"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_x "0.02"

// Y position of the text.
// -
// Default: "0.15"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud3_y "0.15"

// 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"

// Overwrite the HUD flag.
// For debug purposes only.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "32767.000000"
l4d2_scripted_hud_hud4_flag_debug "0"

// Text area Height.
// -
// Default: "0.026"
// Minimum: "0.000000"
// Maximum: "1.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.
// -
// 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.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_width "1.0"

// X position of the text.
// -
// Default: "0.75"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_x "0.75"

// Y position of the text.
// -
// Default: "0.35"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_scripted_hud_hud4_y "0.35" 

Admin Commands
  • sm_print_cvars_l4d2_scripted_hud => Print the plugin related cvars and their respective values to the console. (z flag required)

Change Log

Spoiler


Known Issues
  • If your HUD is hiding and showing very fast probably you have some <gamemode>.nut file conflicting with the plugin.
  • This plugin conflicts with the "Admin System" addon by Rayman1103 (GameMaps / Steam Workshop)
  • This plugin will conflict with any plugin that changes the <gamemode>.nut file. (check Related Plugins section)
  • This plugin will conflict with any addon or map that changes the <gamemode>.nut file. (check it by opening the .vpk and going to the "scripts\vscripts\" folder)

Notes
  • You MUST have a file with your gamemode in the "\left4dead2\scripts\vscripts\" folder. (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 client screen 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).
  • Setting the background cvar from "1" 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.
  • 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.

Thank you!

Related Plugins

Post Reply
  • 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. (e.g. scripts/vscripts/coop.nut)

Your <gamemode>.nut file content MUST have the following line otherwise, the plugin won't work:

PHP Code:

HUDSetLayout({}) 

Code snippet inside the "l4d2_scripted_hud_rename.nut" file.

Installation
  • 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. (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")

Attached Files
File Type: zip l4d2_scripted_hud.zip (472 Bytes)
File Type: sp Get Plugin or Get Source (l4d2_scripted_hud.sp - 57.2 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...