Left 4 Dead 2

Left 4 Dead 2

70 ratings
Throwable Melee Weapons Advanced (Vscript)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Weapons, Scripts, Miscellaneous
Game Modes: Single Player, Co-op
Weapons: Melee
File Size
Posted
Updated
39.548 KB
13 Feb @ 11:21am
3 Jun @ 8:44am
14 Change Notes ( view )

Subscribe to download
Throwable Melee Weapons Advanced (Vscript)

In 1 collection by kurochama
Unique Weapons with Special Features
62 items
Description
This one is the version with a cfg file. I decided to make a new one instead, because some mechanisms have changed. So, the prototype version is still available, in case if some people prefer the prototype version. I used the same animated previews, as basically it's still the same, with only the damage mechanisms changed.

The main mechanisms are still the same. To throw melee weapon, you only need to hold RELOAD button & then press FIRE button, or simply press ZOOM button. Melee will return automatically, & the time until the melee returns can be adjusted via cfg file.

The list of features available on "throwable melee weapons.txt":
  1. Melee Throw Hit Cooldown: How long until the melee returns to the owner after a successful hit on a zombie. Default value is 1 (1 second). Min value= 0 (instant return), max value= no limit.

  2. Melee Throw Miss Cooldown: How long until the melee returns to the owner after it hits objects or misses. Default value is 5 (5 seconds). Min value= 0 (instant return), max value= no limit.

  3. Melee Damage Multiplier On Common: The damage multiplier on common infected hit with melee throw. The damage multiplier is based on target's current health. The target hit with melee throw will stumble. It's in float/ decimal. Min value= 0.01 (1% of target's current health), max= 1 (instant kill, damage is equal to target's health).

  4. Melee Damage Multiplier On Smoker: Same as above, but for Smoker.

  5. Melee Damage Multiplier On Boomer: Same as above, but for Boomer.

  6. Melee Damage Multiplier On Hunter: Same as above, but for Hunter.

  7. Melee Damage Multiplier On Spitter: Same as above, but for Spitter.

  8. Melee Damage Multiplier On Jockey: Same as above, but for Jockey.

  9. Melee Damage Multiplier On Charger: Same as above, but for Charger.

  10. Melee Damage Multiplier On Tank: Same as above, but for Tank. A special case, tank only has 20% chance to stumble.

  11. Melee Damage Multiplier On Witch: Same as above, but for Witch.

  12. Melee Area Damage Multiplier: This one is applied on common infected near the target that take shockwave damage. The damage multiplier formula is the same as above.

  13. Melee Throw Gore Mode: When enabled, common infected killed with melee throw will have parts of their body dismembered/ gibbed/ destroyed. (NOTES: This only works on default L4D2 common infected skins & common infected skin mods that support gibs)

  14. Melee Throw Glow Type: This feature controls the glow on the melee throw, whether it's from dynamic light or from the glow of the melee itself. You can set this to 0 to disable dynamic light on the melee throw.

  15. Melee Spinning Throw: When enabled, melee will spin when thrown.

  16. Melee Warp Pickup: When enabled, you can pick the thrown melee immediately by holding E (Use) key. You can also pick the melee even when climbing a ladder (but you'll lose your grips on the ladder, so you need to grab the ladder immediately when picking a melee during climbing).

  17. Temporary Pistol On Melee Throw: This is enabled by default as this is the original feature. When this is disabled, you won't get pistol after throwing melee (so your secondary slot will be empty if you have melee on secondary slot as default).

The simple mechanisms of "Throwable Melee Weapon":
  • Hold RELOAD button & then press ATTACK to throw the melee you're holding. Alternatively, you can simply press SCOPE/ ZOOM button to throw.

  • You'll temporarily get a pistol after throwing your melee. If you have a primary gun, you'll switch to primary gun instead of secondary.

  • The thrown melee will have a special dynamic light following it, so it works like flare.

  • When it successfully hits zombies (CI, SI, tank, & witch), there will be a small shockwave special effect.

  • The damage is based on damage multiplier features on the cfg file.

  • The thrown melee can destroy breakable objects. Custom bosses/ enemies in custom campaigns may be included as long as they can take damage.

  • When the thrown melee hits zombies, there's 1 second of cooldown until the melee automatically returns to the owner. This can be changed via cfg file.

  • When the thrown melee hits objects or misses, there are 5 seconds of cooldown penalty until the melee automatically returns to the owner. This can be changed via cfg file.

  • You can throw the melee at other survivor, but it will deal no damage. Instead, the survivor thrown with melee will stumble & use some voicelines to complain, or scream (don't try to throw it at Zoey or Louis, ok :D ).

  • The melee throw can bypass riot zombie's armor.

  • If you throw melee when you're hanging from the ledge or incapacitated, melee won't return. But you can use "Melee Warp Pickup" & hold E (Use) after you stand up again to pick the melee automatically, no matter how far the melee is.

  • If you throw melee while climbing, the melee won't return automatically but when using "Melee Warp Pickup", the E (Use) key can be used to pick the melee no matter how far it is. However, the moment you press E, you'll lose your grip on the ladder, so make sure to grab the ladder again after you press E to pick the melee.


Q: "Does this work on custom melee weapons?"
A: "As long as they're not custom melee weapons with special features/ powers like flamethrower, rocket launcher, Celestial Melee Weapons etc, it will work. Actually it also works on those custom melee weapons with special powers, but it would be funny to throw your flamethrower instead of using it to burn zombies, wouldn't it? Heheheheh..."


So, with this mod, you can have a semi-boomerang melee to support you as a melee wielder, so you can also deal long range even without pistols.


NOTES:
  • Damage multiplier features can be set above 1, but it's better to set it to 1 max, because setting the value to 1 is already equal to instant kill on hit.
  • A secret feature: If you set "Melee Throw Miss Cooldown" to high value & then pick the melee manually, you'll get a "One-Time-Protection Flare" in melee range that makes you a glowing survivor & the flare deals damage to any zombies coming close to you in melee range. This also works on special infected's abilities that pin a survivor.
  • A known bug: If you use SCOPE/ ZOOM to throw the melee, the melee will be thrown farther than when using RELOAD + FIRE, as if it's thrown with lower gravity (no idea how this could happen, as the throw mechanisms are actually the same, with only different keys to press).
  • This can't be used together with "Melee Sharpshooting" mod, as this also uses SCOPE/ ZOOM button to throw melee.
  • If you prefer the old version, you can go here: Throwable Melee Weapons (Prototype)
102 Comments
kurochama  [author] 18 Aug @ 11:42pm 
@Cr0w , probably there were some errors on console after you modified some scripts. It would be easier to check if you make a new discussion thread, & then copy-paste which parts of scripts you modified there. Sometimes removing some scripts may cause errors if there are some important scripts deleted by accident.
Cr0w 18 Aug @ 4:04pm 
I wasn't sure how to explain it, but I was trying to make the world a valid target for an area of effect to occur and also remove the requirement of a button press for activation to make throwing the primary fire. I couldn't seem to remove the requirement without it resulting in it lightly throwing the weapon with no effect.
kurochama  [author] 17 Aug @ 7:34pm 
@ Cr0w , what alterations? You can open a discussion thread on this mod to discuss, as comments don't support format for codes.
Cr0w 17 Aug @ 4:26pm 
I'm attempting to make a version of this with a couple alterations and I was wondering if I could discuss this with you.
Bonnie 15 Jul @ 2:42pm 
weird that your version but not him, is not conflict melee frenzy btw
kouga 14 Jun @ 8:00am 
@kurochama thanks. ill reach out to you once my schedule is a bit more free
kurochama  [author] 11 Jun @ 4:32am 
@Kouga , I just sent you a friend request.
kouga 10 Jun @ 9:21pm 
@kurochama i've uploaded the aim to shoot version now, https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3496527153
once again, thank you for your help

as for your tips, would you mind if i sent you a friend request on either steam or discord to inquire further assistance on how to pull off each point? thank you
kurochama  [author] 7 Jun @ 1:11am 
@Kouga , for each point:
1. You need to rename the melee script on the melee model names (see my "Flamethrower with GL Skin" for knife).
2. To spawn an item when empty-handed, you can use "weapon_drop" & set it only if secondary slot is empty (no weapon). I think my "Throwable Melee" already has the example for that.
2.5. I think there's a mod that gives magnum as the gun when incapped, though I'm not sure if that can solve the pistol problem.
3. You can exclude a melee from being throwable by using the model names to register the melee (see my "Knife Throwing Arts" for the way to register melee model name).
kouga 5 Jun @ 12:00am 
btw, i mentioned 2.5) because i plan on greatly changing the function of pistols as well in the gameplay. currently, the "Primary Slot Pistols" mod make it so you spawn with a pistol as a primary slot, which works fine and well. And with the rise of the current edit of "Throwable Melee" you helped me create, it really shows some fun potential! the only problem is that when you get incapped, you still are given the pistol as a replacement primary, whch again gives the unwanted effect of dropping your current primary weapon and spawning a pistol out of thin air. it gives off a feeling of an infinite duplication glitch which is not what im going for.

as for 3) im not sure how to tackle exactly. i think youve mentioned before that its possible to make "Throwable Melee" to leave it as an exception? but in case that isnt possible or is too much work, would destroying the weapon and giving it back as soon as it leaves your hand be a good idea? what do you think could be done?