Left 4 Dead 2

Left 4 Dead 2

57 ratings
Special Weapons Reloaded
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player
File Size
Posted
Updated
42.989 KB
24 May, 2024 @ 3:40pm
14 Jun, 2024 @ 4:12pm
21 Change Notes ( view )

Subscribe to download
Special Weapons Reloaded

Description
Not modding l4d2 anymore feel free to use my code for anything just give me credit

Started off as a modified version of Grenade Launcher & M60 Fix, but I have since rewritten most of it and added a new feature.

Only works in Local Server or Singleplayer

VSLib is REQUIRED won't work without it

Warning
For anyone testing the special ammo feature in the TUMTaRA map don't use the already placed ammo packs they are actually buttons that transform your current mag into special ammo and my changes don't apply to it.

Changing the max ammo to a value above 1000 will result in weird display bugs but should work as intended (i hope).
(same with mag sizes except its 255 i think, if you're using a mod that changes them)

Features
  • Allows to pickup M60 and grenade launcher ammo;
  • Allows to change the M60 and grenade launcher max reserve ammo;
  • Prevents M60 from being dropped when empty;
  • Allows M60 to gain an extra mag when picking up special ammo(default behavior for other guns).

Mods you might want to use with this:
M60 on ALL Campaigns
Secondary M60
Secondary Grenade Launcher
[GL] MK32 War Machine HUD script
Slight Adjusted M60 (w/ CS:GO Reload anim)
M60 - Enhanced Left 4 Dead 1 Animations
Default M60 animations
PAYDAY2 M60 (for M60)

Chat Commands (not case sensitive)
!swrHelp
Displays all commands and how to use them
!swrCurrent
Displays the current values for all commands
!swrDefault
Restores all values to default
!m60MaxAmmo
Changes the max amount of M60 reserve ammo
!m60GetAmmo
Changes the ability to get M60 ammo
!m60ExtraSpecial
True: get extra full mag when picking up special ammo; False: gives max amount possible (full mag or whatever is left); Compat: turned off (meant for compatibility)
!noDrop
Stops M60 from dropping when empty
!glMaxAmmo
Changes the max amount of GL reserve ammo
!glGetAmmo
Changes the ability to get GL ammo

Config files in "left4dead2\ems\swreloaded" in case you want to delete them or something

Changes from original mod:
  • Features now apply to M60 and GL even in secondary slot;

  • Server restart no longer needed to apply configs, however if you change the reserve ammo of the M60 or GL it will only apply to newly picked up ones;

  • Changed name of the commands, and responses a tiny bit;

  • New commands:
    • help
    • current
    • default

  • Added extra special ammo for M60 feature (temporarily disabled due to a bug);

  • M60 now automatically reloads, but this unfortunately can cause M60 pickup voice lines being played (fixed but subtitles still show up).

Compatibility
  • Should work with any mod that changes special ammo as long as the compat mode is on.

  • When using Weapon Timer Enforcer M60 pickup animation will play for normal duration when reloading on empty effectively making it take longer to reload, unless the M60 pickup duration is changed in the config, or Orinuse decides to make a compatibility patch.

Known issues:
- Ammo pile glow doesn't change to white to show that it is interactable when ammo bellow max (after many attempts I was unable to change the glow at all). - Can't pickup ammo for M60 and GL while reloading (can't detect the event of interacting with ammo pile while reloading). - When M60 with special ammo becomes empty and extra special is true M60 is deleted. - M60 in secondary slot when empty displays -1 instead of 0 but works as intended. - M60 when reloaded after using all special ammo will still display 0 until 1 shot is fired. - M60 doesn't automatically reload. - When special ammo for M60 is picked up it will only give the amount the weapon currently has on the mag (default behavior), so when tried to pickup special ammo for a currently empty M60 no special ammo will be given and ammo pack won't be interactable for that person anymore. - Dropping empty M60 will cause it to not be able to be picked again. - Picking up ammo while having mag with both special and regular ammo gives wrong amount. - Picking up special ammo for M60 after reloading with special ammo in the mag will cause ammo to disappear. - Alternating extra special between true and not true will cause max ammo values to be incorrect when not true. - Picking up ammo for M60 while having special ammo with extra special off gives more ammo than it should.

Special thanks to:
Devlos/Solved and the original mod creator for inspiring me to make this (and providing the base code)
Nescius for making Item thrower which made testing some bugs easier
25 Comments
Ambition  [author] 6 Feb @ 3:50am 
glad i could help
Sleepy King 5 Feb @ 10:03pm 
i figured it out, i had a sourcemod configuring the m60 ammo and didnt actually set the ammo using your addon
Ambition  [author] 5 Feb @ 10:14am 
If i remember correctly i had set the default reserve ammo to 150 but some other mod could be messing with it.
Ambition  [author] 5 Feb @ 10:13am 
Just to be sure you do have reserve ammo right? Because you can change the max reserve ammo with a command.
Sleepy King 5 Feb @ 7:31am 
it doesnt do that for me by default it just infinitely cycle through the ammo until its empty
Ambition  [author] 5 Feb @ 7:04am 
that is how the mod should function by default
Sleepy King 5 Feb @ 6:16am 
i didnt fully test it nor tweaked it, was that always a option? lol
Ambition  [author] 5 Feb @ 5:55am 
I am a bit confused as to what you mean, the mod is suppose to make it so you can reload the guns like any other in the game, unless it broke since I last tested it.
Sleepy King 5 Feb @ 5:25am 
This mod is really impressive, and I love the concept! However, I think adding the reloading feature back would really elevate it even more. While the infinite ammo is fun and all, I personally feel that being able to reload, just like the original game mechanic, would add a lot more depth and realism to the experience. It would give players more of a sense of immersion and strategy, especially during intense moments. I’d love to see that option available again
Banana 1 Oct, 2024 @ 8:13am 
@Ambition i sent you a friend request.