AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [L4D2] Infected Hud Health Bar (https://forums.alliedmods.net/showthread.php?t=321565)

xZk 02-17-2020 00:12

[L4D2] Infected Hud Health Bar
 
5 Attachment(s)
Intro
This plugin is inspired by Infected Health Gauge plugin, this will allow to give relative knowledge of the health of the infected through a health bar
Details
The health bar is shown on the hud "env_instructor_hint", through a text within it, you can change the size of the bar width, as well as the text that represents the points of damage and health.

Cvars:
PHP Code:

// 0:Disable , 1:Enable Plugin
// -
// Default: "1"
l4d2_infected_hudhpbar_activated "1"

// 0:Disable, 1:Enable Show Hud HP Bar for Boomer
// -
// Default: "0"
l4d2_infected_hudhpbar_on_boomer "0"

// 0:Disable, 1:Enable Show Hud HP Bar for Charger
// -
// Default: "0"
l4d2_infected_hudhpbar_on_charger "0"

// 0:Disable, 1:Enable Show Hud HP Bar for Hunter
// -
// Default: "0"
l4d2_infected_hudhpbar_on_hunter "0"

// 0:Disable, 1:Enable Show Hud HP Bar for Jockey
// -
// Default: "0"
l4d2_infected_hudhpbar_on_jockey "0"

// 0:Disable, 1:Enable Show Hud HP Bar for Smoker
// -
// Default: "0"
l4d2_infected_hudhpbar_on_smoker "0"

// 0:Disable, 1:Enable Show Hud HP Bar for Spitter
// -
// Default: "0"
l4d2_infected_hudhpbar_on_spitter "0"

// 0:Disable, 1:Enable Show Hud HP Bar for Witch
// -
// Default: "1"
l4d2_infected_hudhpbar_on_witch "1"

// 0:Disable, 1:Enable Show Hud HP Bar for Tank
// -
// Default: "1"
l4d2_infected_hudhpbar_on_tank "1"

// Set range Instuctor Hint For Tank (0 = infinite range)
// -
// Default: "750.0"
// Minimum: "0.000000"
// Maximum: "750.000000"
l4d2_infected_hudhpbar_range "750.0"

// Set time out in seconds HP Bar (0 = no time out)
// -
// Default: "3.0"
// Minimum: "0.000000"
l4d2_infected_hudhpbar_showtime "3.0"

// Set width size for health bar
// -
// Default: "10"
// Minimum: "2.000000"
// Maximum: "100.000000"
l4d2_infected_hudhpbar_size "10"

// Set text for damage point
// -
// Default: "··"
l4d2_infected_hudhpbar_textdmg " "

// Set text for health point
// -
// Default: "-"
l4d2_infected_hudhpbar_texthp "-"

// Set text for dead hint ("" = no dead hint)
// -
// Default: ""
l4d2_infected_hudhpbar_textdead ""

// Set RGB color for full HP
// -
// Default: "0,255,0"
l4d2_infected_hudhpbar_colorfull "0,255,0"

// Set RGB color for half HP
// -
// Default: "255,255,0"
l4d2_infected_hudhpbar_colorhalf "255,255,0"

// Set RGB color for critic HP
// -
// Default: "255,0,0"
l4d2_infected_hudhpbar_colorcritic "255,0,0" 

Credits:
MasterMind420: for his code [L4D2]Infected Hud plugin
BHaType: for his code Hint plugin
Silvers: for his useful tips [TUT]SourcePawn Scripting - Tips, Basics to Advanced


Changelog:
Code:

2020-10-14 (v1.2)
* Added new cvar for enabling HP Bar on Witch
* Added CFG file for customize HP Bar for each Special Infected

2020-02-22 (v1.1)
* Fixed set custom characters in cvars text points
* Added new cvar for hint on infected dead
* Added new cvars for custom colors on HP Bar

2020-02-17 (v1.0)
* Initial release.

Rant:
-put Attachment 184393 in "/addons/sourcemod/data/" folder if this file is not autogenerated.

strikeraot 02-17-2020 01:47

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Plugin failed to compile! Please try contacting the author.

BloodyBlade 02-17-2020 12:06

Re: [L4D2] Infected Hud Health Bar
 
The plugin uses sdktools and sdkhooks.
You need to compile the plugin locally.

BloodyBlade 02-17-2020 12:09

Re: [L4D2] Infected Hud Health Bar
 
@xZk, please download the compiled version in your post.

xZk 02-17-2020 15:14

Re: [L4D2] Infected Hud Health Bar
 
fixed, had been changed to the v1.0 compiler...changed to 1.9

Marttt 02-17-2020 18:25

Re: [L4D2] Infected Hud Health Bar
 
nice plugin xZk,

I did a similar one, but didn't share here yet, because I want to make it playable for versus making it visibility team-based, Mastermind had given me some tips but I didn't have time to implement by now.

As a suggestion, for future releases, add the hud also to the witch.

xZk 02-18-2020 12:55

Re: [L4D2] Infected Hud Health Bar
 
Thanks, I did not want to share it before because it was in conflict with the Infected Hud Mastermind plugin, but the 2 work well :D, about the witch possibly in the next update I will add it, in addition to other things to better customize the hp bar for each class of infected

MasterMind420 02-18-2020 17:05

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by xZk (Post 2684299)
Thanks, I did not want to share it before because it was in conflict with the Infected Hud Mastermind plugin, but the 2 work well :D, about the witch possibly in the next update I will add it, in addition to other things to better customize the hp bar for each class of infected

Honestly if you wanted to add numbers as well as an option I would take no offense, merge the 2 if you want. I don't code as much as I used to so it's all good.

xZk 02-22-2020 15:19

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by MasterMind420 (Post 2684327)
Honestly if you wanted to add numbers as well as an option I would take no offense, merge the 2 if you want. I don't code as much as I used to so it's all good.

I think I explained myself badly, what I meant was that this plugin did not know how to make it compatible with yours before, without conflicts, since if one worked the other did not, but now both plugins could work together independently of each other :)

Voevoda 04-16-2020 16:34

Re: [L4D2] Infected Hud Health Bar
 
does not work

Marttt 04-16-2020 16:48

Re: [L4D2] Infected Hud Health Bar
 
You need to give some more information, "does not work" is not helpful.
Anyway, I have seen a couple of server running this plugins and working.

It will only work if you have set "gameinstructor_enable 1" in console, check if you have it enabled.

Voevoda 04-16-2020 16:58

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by Marttt (Post 2693920)
You need to give some more information, "does not work" is not helpful.
Anyway, I have seen a couple of server running this plugins and working.

It will only work if you have set "gameinstructor_enable 1" in console, check if you have it enabled.

thanks

SilentBr 07-07-2020 20:58

Re: [L4D2] Infected Hud Health Bar
 
Thanks for your work, I loved this HP HUD.

I found a bug, sometimes the dmg and hp text won't display, if I reload the plugin same issue, if I force sm_cvar works for one map only, then disappears.

I fixed myself doing this:
Code:

public void OnPluginStart()
{
...
...
...
CreateTimer(5.0, text);
}

public Action text(Handle timer)
{
                SetConVarString(cvarTextHealth, "■");
                SetConVarString(cvarTextDamage, "□");
}


Profanuch 07-19-2020 05:43

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by SilentBr (Post 2709164)
Thanks for your work, I loved this HP HUD.

I found a bug, sometimes the dmg and hp text won't display, if I reload the plugin same issue, if I force sm_cvar works for one map only, then disappears.

I fixed myself doing this:
Code:

public void OnPluginStart()
{
...
...
...
CreateTimer(5.0, text);
}

public Action text(Handle timer)
{
                SetConVarString(cvarTextHealth, "■");
                SetConVarString(cvarTextDamage, "□");
}


I really liked your version. There is a problem, after restarting the server, the plugin is reset by default settings. When you kill a tank there is this bug. How to fix it?
https://i.imgur.com/VYIJo5D.png
google translate :)

SilentBr 08-17-2020 11:03

Re: [L4D2] Infected Hud Health Bar
 
1 Attachment(s)
Quote:

Originally Posted by Profanuch (Post 2710718)
I really liked your version. There is a problem, after restarting the server, the plugin is reset by default settings. When you kill a tank there is this bug. How to fix it?
google translate :)

Here is the edited version that I'm running. No problems anymore with the texts being empty after restart/map change.

You'll have to manually change the text if you want a different one. In my opinion this is the best :)

beefjerky331 10-08-2020 23:05

Re: [L4D2] Infected Hud Health Bar
 
thanks for sharing, this is a good plugin :)

xZk 10-14-2020 20:33

Re: [L4D2] Infected Hud Health Bar
 
update now you can customize better hp bar
Code:

2020-10-14 (v1.2)
* Added new cvar for enabling HP Bar on Witch
* Added CFG file for customize HP Bar for each Special Infected


beefjerky331 10-14-2020 23:27

Re: [L4D2] Infected Hud Health Bar
 
hey dude,new version something problem here. maybe just code sort problem?

my system environment:
LINUX(Ubuntu)
sourcemod 1.10


console run [sm plugins list] after display :
Quote:

Errors:
l4d2_infected_hudhpbar.smx ([L4D2] Infected Hud Health Bar): Error detected in plugin startup (see error logs)

Errorlog:
Quote:

L 10/15/2020 - 11:25:02: [SM] Exception reported: Instruction contained invalid parameter
L 10/15/2020 - 11:25:02: [SM] Blaming: l4d2_infected_hudhpbar.smx
L 10/15/2020 - 11:25:02: [SM] Call stack trace:
L 10/15/2020 - 11:25:02: [SM] [1] Line 131, /home/forums/content/files/2/8/2/8/8/8/179821.attach::EnablePlugin
L 10/15/2020 - 11:25:02: [SM] [2] Line 117, /home/forums/content/files/2/8/2/8/8/8/179821.attach::OnPluginStart
L 10/15/2020 - 11:25:02: [SM] Unable to load plugin "l4d2_infected_hudhpbar.smx": Error detected in plugin startup (see error logs)

xZk 10-15-2020 13:59

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by beefjerky331 (Post 2721379)
hey dude,new version something problem here. maybe just code sort problem?
Errorlog:

I have no idea why it gives that error on windows works well, I also don't have a linux to test sorry :/

psycki 10-17-2020 18:32

Re: [L4D2] Infected Hud Health Bar
 
@beefjerky331
I had this same problem on windows, I turned on the server only with this plugin and it worked and I added the other plugins little by little and gave "sm plugins refresh" and "sm plugins list" to try to find out if it was a conflict, the strange part is that it is working normally with all plugins after I did that.

beefjerky331 10-19-2020 07:26

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by psycki (Post 2721712)
@beefjerky331
I had this same problem on windows, I turned on the server only with this plugin and it worked and I added the other plugins little by little and gave "sm plugins refresh" and "sm plugins list" to try to find out if it was a conflict, the strange part is that it is working normally with all plugins after I did that.

yes i also

cacaopea 10-24-2020 08:03

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by xZk (Post 2722334)
for those with the error: Exception reported: Instruction contained invalid parameter
please test this version:

hello,I have tested your plugin, and still have an error message: Exception reported: Instruction contained invalid parameter
I think it conflict with plugin: L4D2 Weather Control

moekai 11-01-2020 01:40

Re: [L4D2] Infected Hud Health Bar
 
Quote:

Originally Posted by xZk (Post 2722334)
for those with the error: Exception reported: Instruction contained invalid parameter
please test this version:

This problem still occurs
PHP Code:

L 11/01/2020 00:52:31: [SMException reportedInstruction contained invalid parameter
L 11
/01/2020 00:52:31: [SMBlamingstatistical\l4d2_infected_hudhpbar.smx
L 11
/01/2020 00:52:31: [SMCall stack trace:
L 11/01/2020 00:52:31: [SM]   [1Line 118, /home/forums/content/files/2/8/2/8/8/8/184640.attach::OnPluginStart
L 11
/01/2020 00:52:31: [SMUnable to load plugin "l4d2_infected_hudhpbar.smx"Error detected in plugin startup (see error logs

Quote:

Originally Posted by cacaopea (Post 2722386)
hello,I have tested your plugin, and still have an error message: Exception reported: Instruction contained invalid parameter
I think it conflict with plugin: L4D2 Weather Control

I don't have that plugin and still received the error

JimmyXD 03-29-2021 06:10

Re: [L4D2] Infected Hud Health Bar
 
Hello! I have just begun my journey in modding, so I have a very basic question. So far I have not seen any mods on the Steam L4D2 workshop that allow the display of the health bars of special infected. I wonder if it is possible to make such a mod, which can be put on the workshop and people can subscribe to. If not, could you please let me know why? Thanks!

BAILOPAN 08-07-2021 15:52

Re: [L4D2] Infected Hud Health Bar
 
The "invalid parameter" error is a compiler bug that will be fixed in SourceMod 1.11. I have no idea if the plugin works otherwise, but the exact error in post #24 etc was a SourceMod issue.

thewintersoldier97 07-09-2022 07:12

Re: [L4D2] Infected Hud Health Bar
 
Very nice plugin :D Thank you!


All times are GMT -4. The time now is 21:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.