Left 4 Dead 2

Left 4 Dead 2

211 ratings
Melee Frenzy (Fast Melee Attack)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player, Co-op
Weapons: Melee
File Size
Posted
Updated
70.001 KB
29 Nov, 2023 @ 12:52pm
18 Jun @ 9:48am
14 Change Notes ( view )

Subscribe to download
Melee Frenzy (Fast Melee Attack)

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
46 items
Description
Have you ever thought about "What if I can make melee attack fast enough?" or "What if I can change melee attack speed during play as I like?". Well, this mod is your answer.

This simple mod can modify melee attack speed in which even katana can attack as fast as knife (or faster), & fireaxe can attack as fast as machete.There's "melee frenzy cfg.txt" in ems that will allow you to set your own melee attack speed.

Here are some features that can be turned on/ off at will:
- Melee Attack Speed: Melee attack speed can be set from 1 to 50 max.
- Knockback Melee Power: Melee attack can stagger special infected, & also tank, depending on the value set.
- Bonus Melee On First Spawn: Survivors can get free random melee weapons on first stage.
- Health Buffer Bonus: Killing zombies with melee can get health buffer. Common= 2, Special= 5, Tank= 25, Witch= 50.
- Melee Damage Resist: When holding melee, survivors have damage resist equal to (value * 1%), & max value is 50 (50%)
- Melee Shockwave: When attacking with melee, shockwave in melee range radius is unleashed on each attack & either stumbles or damages zombies in 360 degrees around survivor. The value affects which type of shockwave is triggered.
- Melee Roulette: When holding E & then shove any objects, survivor can switch secondary between pistol & random melee. The value affects which type pistol obtained during switch.
- Melee Dash: When holding E & then attack with melee, survivor can dash forward to the direction of the crosshair. Depending on how it's used, survivor can simply just dash forward or jump higher than usual (like a hunter).
- *NEW* Melee Frenzy Mode: Which mode is used for "Melee Attack Speed". 0= Default mode via timer. 1= Alternative mode via event function (use this if the default mode makes you lag).

Enjoy your melee battle...

Notes:
- If you see some zombies flying on my preview later, that's not from this mod but from cvar "melee_force_scalar 5000". This mod doesn't change any cvars related to melee.
- On "Melee Roulette" feature, there's a random chance that you'll get 2 melee at once (one that you carry & one on the ground) if you switch too fast or too often.
- on Melee Dash feature, if you jump & aim downward 90 degrees & then trigger Melee Dash, you can cause fall damage on yourself. So, avoid aiming downward more than 45 degrees when using Melee Dash.
168 Comments
kurochama  [author] 21 Jul @ 11:39am 
@Immortallnd , try to play Singleplayer in any map. Then, after your character spawns in the map, exit to main menu. Check the "ems" folder. The "melee frenzy" folder will be there.
Immortallnd 21 Jul @ 11:11am 
I cant find an ems, I don't know if i did anything wrong but im going to try reinstalling
kurochama  [author] 20 Jul @ 10:00pm 
@Immortallnd , check ".../Left 4 Dead 2/left4dead2/ems/" for the cfg file.
Immortallnd 20 Jul @ 6:30pm 
New to the game, I having a hard time figuring out how this mod works ngl, just a bit lost
EVIL_SUPRESOR 15 Jul @ 1:54am 
@Kurochama, In essence, that's how it is, yes - that script somehow calculates what kind of weapon the player is currently holding and sets a different value when receiving damage, simulating damage resistance. But there is a direct change there, and yours is dynamic (with settings and a whole percentage calculation system).

It's just that in your case, as I said, there is a mini-bug when, with 50% protection, a zombie on an expert deals 10 damage to the player, but if the player has 20 or less left, the script does not have time to make the calculation, which is why the player receives the full 20 damage and eventually falls. In the case of the previously described script from another author, such a mini-bug is not observed. I don't understand how he did it, because when viewing the script internally, there are the same "variables" for receiving damage as you have... So I'm sharing the information - maybe this will help you with modding!

Thank you for your attention, author!
kurochama  [author] 14 Jul @ 11:48am 
@ EVIL_SUPRESOR , so, what you meant was something like "flat damage", right? For example, like this:
1. Percentage-based damage resist (auto): main damage - 50%
Normal tank: 25 = 25 * 0.5 = 12.5 (13 damage)
Expert tank:100= 100 & 0.5= 50
2. Flat damage (manual)= Zombietype damage by difficulty
Normal Tank= 10
Expert Tank= 30
Normally it should be possible, but the methods will be much simpler with the "percentage-based damage resist", as it scales the damage resist automatically based on the main damage (it works automatically on any difficulty levels), while the "flat damage" may require to manually set the damage based on each difficulty level.
EVIL_SUPRESOR 14 Jul @ 8:46am 
I apologize for such an incorrect translation, since the wording here is quite tricky. But I will try to explain it this way: I saw a system in the script for the riot shield that also reduces damage, but differently: instead of the stated 65% damage reduction, it set something like a fixed value of damage to the player with this riot shield. Like, logically, 65% damage from a tank should be exactly 35 points, but the script indicates that the damage that the tank will inflict on the player will be equal to 33 points, not 35. And so with all the variables regarding the infected: regular zombies on expert do not inflict 7 damage, as they should according to the logic of 65% protection, but exactly 5 points of damage. Because the creator of the mod set a FULL value of "protection" for a melee item.
kurochama  [author] 14 Jul @ 6:45am 
@EVIL_SUPRESOR , I still can't understand some of what you explained (like the coefficient thing & what kind of damage resist you wanted to explain about protection value). But on the update before updating the "Melee Frenzy Mode", I changed the mechanisms of "Melee Damage Resist" to apply to all damage & tested on a witch on Normal difficulty. I took 50 damage instead of 100 with 50% damage resist. So, if witch that normally can instantly incapacitates a survivor only deals 50 damage, it means that the damage resist works. & yes, the damage mechanisms on the "player_hurt" event function count the original damage first before it's reduced by the damage resist percentage.
EVIL_SUPRESOR 14 Jul @ 4:00am 
It would be easier if your script fixed the incoming damage coefficient (I saw this in a similar mechanic for another author's shield - inside the script I saw that the damage reduction was converted to a value - where the damage resistance is not 65%, but simply the damage coefficient upon receiving is set approximately equal to the protection value).

My job is only to note this feature, but to do something with it is up to you. But I like your modification!
EVIL_SUPRESOR 14 Jul @ 3:59am 
I think I figured out why a tank can one-shot a player, and why other zombies can one-shot him with a melee weapon with +50% damage resistance - the game/script counts incoming damage AFTER it's been counted, hence the problem: at 20 health, the player gets knocked down by regular zombies in one hit, although before that they dealt 10 points of damage. The same applies to the tank: I took mods for testing that reduce the tank's damage by 50%. This results in the tank doing 25 points of damage with your resistance... 25 points of damage until the player's health drops to 50 and below - after which the tank just deals one hit.