Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Witch/Tank Damage Announce - No Report and Wrong Percentage #821

Open
deprid opened this issue Sep 19, 2024 · 6 comments
Open

[BUG] Witch/Tank Damage Announce - No Report and Wrong Percentage #821

deprid opened this issue Sep 19, 2024 · 6 comments

Comments

@deprid
Copy link

deprid commented Sep 19, 2024

##Describe the bug
When 5 or more survivors do some damage to a Witch/Tank, no damage report gets produced or the percentage does not add up to 100% in the damage report. Both l4d_witch_damage_announce as well as l4d_tank_damage_announce have this bug.

Related SourceMod error log:

Witch:

L 09/19/2024 - 17:03:09: [SM] Exception reported: Invalid memory access
L 09/19/2024 - 17:03:09: [SM] Blaming: l4d_witch_damage_announce.smx
L 09/19/2024 - 17:03:09: [SM] Call stack trace:
L 09/19/2024 - 17:03:09: [SM]   [1] Line 250, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::PrintWitchDamage
L 09/19/2024 - 17:03:09: [SM]   [2] Line 214, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::CalculateWitch
L 09/19/2024 - 17:03:09: [SM]   [3] Line 186, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::WitchDeath_Event
L 09/19/2024 - 17:03:09: [SM] Exception reported: Invalid memory access
L 09/19/2024 - 17:03:09: [SM] Blaming: l4d_witch_damage_announce.smx
L 09/19/2024 - 17:03:09: [SM] Call stack trace:
L 09/19/2024 - 17:03:09: [SM]   [1] Line 250, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::PrintWitchDamage
L 09/19/2024 - 17:03:09: [SM]   [2] Line 214, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::CalculateWitch
L 09/19/2024 - 17:03:09: [SM]   [3] Line 203, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::PrintAnyway
L 09/19/2024 - 17:13:32: Error log file session closed.

L 09/17/2024 - 22:57:16: [SM] Exception reported: Invalid memory access
L 09/17/2024 - 22:57:16: [SM] Blaming: l4d_witch_damage_announce.smx
L 09/17/2024 - 22:57:16: [SM] Call stack trace:
L 09/17/2024 - 22:57:16: [SM]   [1] Line 250, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::PrintWitchDamage
L 09/17/2024 - 22:57:16: [SM]   [2] Line 219, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::CalculateWitch
L 09/17/2024 - 22:57:16: [SM]   [3] Line 203, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_witch_damage_announce.sp::PrintAnyway
L 09/17/2024 - 22:58:06: Error log file session closed.

Tank:

L 08/09/2024 - 20:46:48: [SM] Exception reported: Invalid memory access
L 08/09/2024 - 20:46:48: [SM] Blaming: l4d_tank_damage_announce.smx
L 08/09/2024 - 20:46:48: [SM] Call stack trace:
L 08/09/2024 - 20:46:48: [SM]   [1] Line 285, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp::PrintTankDamage
L 08/09/2024 - 20:46:48: [SM]   [2] Line 209, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp::Event_RoundEnd

L 08/09/2024 - 20:51:18: [SM] Exception reported: Invalid memory access
L 08/09/2024 - 20:51:18: [SM] Blaming: l4d_tank_damage_announce.smx
L 08/09/2024 - 20:51:18: [SM] Call stack trace:
L 08/09/2024 - 20:51:18: [SM]   [1] Line 285, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp::PrintTankDamage
L 08/09/2024 - 20:51:18: [SM]   [2] Line 226, D:\steamcmd\l4d2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp::Timer_CheckTank

To Reproduce
Steps to reproduce the behavior:

  1. Play in a server with more than 5 or more survivors (coop)
  2. Make sure 5 or more survivors do some damage to a Witch
  3. Bug happens, no damage report get produced or the percentage does not add up to 100%

Screenshots/Video

No Tank damage report:

20240806222022_1
20240807000900_1
20240807223704_1

The percentage does not add up to 100% in the damage report:

20240807223854_1

No Witch damage report:

20240807224820_1
20240814001205_1

Server Operating System (if applicable):

  • Windows

Additional context

// Set minimum # of survivors in game.(Override official cvar 'survivor_limit')
// Kick AI survivor bots if numbers of survivors has exceeded the certain value. (does not kick real player, minimum is 1)
// -
// Default: "4"
// Minimum: "1.000000"
// Maximum: "32.000000"
l4d_multislots_min_survivors "4"
  • An option of displaying the report as:
    • [%] xx [%] xx [%] xx [%] xx
      instead of
      [%] xx
      [%] xx
      would be great especially on my 12 slots server :)
  • Witch Damage Announce 1.3, Tank Damage Announce 1.4 (both are latest as of now)
  • SM v1.11.0.6964
  • Related issue: [BUG] l4d_witch_damage_announce.smx don't work #698
@SirPlease
Copy link
Owner

SirPlease commented Sep 20, 2024

These issues are somewhat out of scope for the design of the plugins in the Competitive repo, but I agree that they are oversights in the code that can be accounted for.

The percentage not adding up to a 100% in the Witch screenshot is working as expected, as you didn't kill the witch. It's scaled off of the Witch's total health, not the damage total.

Your suggestions for the option of displaying percentages next to eachother will (in my opinion) look really messy due to how long people can have their names. 🤔

SirPlease added a commit that referenced this issue Sep 20, 2024
- Resolve errors for setups that don't remove the upperbound value for survivor_limit while still having over 4 Survivors.
- Officially support damage recording for multiple witches at the same time.
- Updated IsTank check to account for L4D1 Servers running this plugin.
- Add a ConVar to control whether we print on incaps or not (Default OFF).
- Add a ConVar to control whether we combine percentages lower than a minimum percentage (Default OFF).
- Add a ConVar to limit the total amount of damage lines printed (Default OFF).
  - Setting this to "5" would limit the prints to either 5 Survivors or 4 (+ "The Other Survivors") when 6 players damaged the witch.
- Add a ConVar for the combination name (Default: "The Other Survivors").
@SirPlease
Copy link
Owner

SirPlease commented Sep 20, 2024

I've reworked the Witch Damage Announce plugin a bit, give it a go and let me know how it goes 😄
Make sure to check out the alternative solutions for the long prints that I've added and let me know if this helps~

@deprid
Copy link
Author

deprid commented Sep 20, 2024

Let us try the new version tomorrow... I just read this and we just done massacring zombies and witches

@deprid
Copy link
Author

deprid commented Sep 21, 2024

Nice man you're the hero, now it detects and displays the full report for 5+ players.

By the way, where can I find the cvars tho? I couldn't seem to find them in the cfg folder... is the .cfg file gets automatically created or needs manual edit in the source file?

@SirPlease
Copy link
Owner

SirPlease commented Sep 21, 2024

Glad to hear it!
You can setup the cvars in the server.cfg or if you're using configs, in their respective plugin cvar files.
None of the plugins in the competitive repository contain anything with a generated config due to issues that can arise between matchmodes.
If you insist on having an automated cfg file, you can add a single line to OnPluginStart() which would be AutoExecConfig(true); and then compile the file.

You can find the cvars in the sourcefile with their description, but I'll provide them here:

  • l4d_wda_print_incap

Do we print the Witch's remaining health when she incapacitates a survivor? (0: Off - 1: On)
Default: 0

  • l4d_wda_print_minimum

What's the minimum percentage of damage we need to do to be listed? (0 = Disabled, everyone listed)
Default: 0

  • l4d_wda_print_max_lines

Maximum amount of damage lines we list (Survivors + Rest) (0 = Disabled, everyone listed)
Default: 0

  • l4d_wda_combination_name

What do we call the combined players? Character limit of 32.
Default: "The Other Survivors"

Something to keep in mind, it will only print once per witch by design.
If you choose to print when a player gets incapacitated it won't print again when the witch dies.


EDIT: Aiming to update the Tank Plugin with a similar rework either later today or tomorrow~

@deprid
Copy link
Author

deprid commented Sep 21, 2024

Alright thanks for the info, didn't know that. And the provided cvar l4d_wda_print_max_lines seems more useful and sensible than my original suggestion.

Looking forward to the updated Tank plugin... and you might want to take a look at MoYu_Server_Stupid_Plugins/The Last Stand/l4d_tank_damage_announce at master · Target5150/MoYu_Server_Stupid_Plugins. Maybe it can helps you a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants