Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
Melee critical strike
   
Award
Favorite
Favorited
Unfavorite
Game Content: Weapons, Scripts
Weapons: Melee
File Size
Posted
120.631 KB
Aug 21, 2024 @ 5:05am
1 Change Note ( view )

Subscribe to download
Melee critical strike

Description
All MELEE weapons has 30 chance to deal 225% damage (coded as extra 115%)
Also includes crit sound

Want guns to crit too ? check out https://steamcommunity.com/sharedfiles/filedetails/?id=3313569540

Made following a request by LE37
Took longer to make than I thought

Let me know in the comments if this is too strong

LOCAL ONLY
might conflict with scripts using game event player_hurt and infected_hurt

Have fun

EDIT: marking this one as won't fix. problems and possible solutions are in comment section. feel free to reupload with your own fix
8 Comments
EVIL_SUPRESOR Jun 8 @ 7:17am 
There were no corrections?
Z  [author] Aug 24, 2024 @ 12:42am 
<3
EVIL_SUPRESOR Aug 24, 2024 @ 12:20am 
And it turned out great anyway! Good luck on the modding path.
Z  [author] Aug 23, 2024 @ 11:30pm 
appreciate the write up, and I figured that out too on further testing after publish

here's some more problems I found:
- melee damage type doesn't deal intended crit damage, but 200 damage (tank) instead
- shotguns calculate chance per pellet, meaning crit is also dealt per pellet and not as a whole
- params.weapon is sometimes missing for unknown reasons for infected_hurt

fix would require
- using a diff damage type to correct deal damage
- restrict crit to melee only (most likely will have to use GetModelName() )

thing was made in a rush, and mostly serves as a template for ppl new to scripting like myself
EVIL_SUPRESOR Aug 23, 2024 @ 11:16pm 
I checked the script. Unfortunately, for some reason it works on all types of weapons (short-range and long-range types). I have one script with crit for two guns (SIG and MP5), but they are fine. I'll even say more: they have their own critical hit that works independently of yours. I also got into your code and... I am not a super-creator of mods for Left 4 Dead, but even I was able to deduce the assumption that in the stanza of the type of damage source (where the weapon class is indicated), clarity for the code is needed, most likely, I think. But otherwise I liked the mod. Great job, friend!
Z  [author] Aug 21, 2024 @ 6:49am 
also just to let you know it's possible to make just 1 weapon do crit, because I think I know what you're gonna make
LE37 Aug 21, 2024 @ 5:36am 
ok:steamhappy: wait a moment I will upload a new item about dota2