Left 4 Dead 2

Left 4 Dead 2

35 ratings
Breakable Guns (Vscript)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Weapons, Scripts
Game Modes: Single Player, Co-op
File Size
Posted
Updated
463.869 KB
25 Jan @ 7:55pm
3 Feb @ 1:54am
5 Change Notes ( view )

Subscribe to download
Breakable Guns (Vscript)

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
50 items
Description
"What if you fight zombies with obsolete/ problematic guns that may get jammed or even explode at any moments? Would you still use them, or pick some melee to smash some zombies?"

Well, this mod is a request, & at the same time to complement a mod about "Melee Can Break". There's melee, so, why wasn't there one for guns? So, here's the mod for that.

Now, this is a complete version. All features are working. Only some minor updates are left.

So, about this mod. This mod allows you to set break probability on each gun, including pistols. There are 4 "Weapon Break Levels" that will be triggered, & weapon only breaks when it reaches "Weapon Break Level 4". The rest of info will be explained on the mechanisms below.

Animated previews:





List of features available on "breakable guns.txt" cfg file:
  1. weapon_break_mode: This is to enable weapon break feature. Set it to 1 to enable it.

  2. weapon_break_user: On which type of survivor the breakable guns will be applied (bots only/ players only/ all).

  3. weapon_break_type: Which type of weapon break will be applied. This affects the final results on "Weapon Break Level 4", whether it's a "Total Ammo Loss" (ammo clip & reserve ammo are set to 0) or "Complete Destruction".

  4. weapon_repair_duration: How long the "Full Repair" will take in seconds. The "Full Repair" will decrease the "Weapon Break Level" to one level.

  5. weapon_fatal_break_multiplier: The multiplier for "Fatal Break". "Fatal Break" is a serious damage that instantly increases "Weapon Break Level" to one level. This one is in decimals (so you can set it to 0.3, 0.5 etc). Min value = 0, max= 1 (always triggers "Fatal Break").

  6. allow_stumble_on_weapon_break: This controls whether survivor will stumble or not when guns break or get jammed.

  7. allow_bot_weapon_to_break: This controls whether bot's guns can break or not. If it's set to 0, bot's guns will only get jammed.

  8. reaction_on_weapon_break: When enabled, survivors will react via voicelines when their guns are jammed or broken.

  9. weaponname_break_chance: Actually there are 19 more features, but I wrote this way instead as the rest of 19 feature represent each weapon (like "weapon_smg_break_chance", "weapon_pistol_break_chance" etc). This control the break probability of "Normal Break" & also affects "Fatal Break" if "weapon_fatal_break_multiplier" isn't set to 0. Min= 0 (no weapon break), max= 100 (100% chance to break).


Mechanisms of "Breakable Guns":
  • Each weapon break chance is controlled by each feature representing it.

  • The break probability is rather tricky, like, even on 10% chance, the "Weapon Break" can still be triggered quite frequently. & it's completely random, like, even on 10% chance, there's a chance when the first shot will cause the gun to trigger "Weapon Break". So, it's recommended to set the value lower than 10 in case if you want to do some balancing on some guns.

  • When "Weapon Break" is triggered, some special effects will show up depending on how serious the damage on the gun is. "Weapon Break Level 1" & "Weapon Break Level 2" only show small sparks when triggered, but "Weapon Break Level 3" will show more sparks, & "Weapon Break Level 4" will show small explosion (but it deals no damage).

  • When "Weapon Break" is triggered, the survivor with the damaged gun will stumble backward. An instructor hint follows soon.

  • "Weapon Break" will cause a "Jammed Gun" state that makes the survivor unable to shoot & even switch to other items. This can only be cancelled by pressing "RELOAD" button.

  • There are 2 types of "Weapon Break": "Normal Break" & "Fatal Break". "Normal Break" will make the gun jammed & can be repaired by reloading. As for "Fatal Break", this is controlled by "weapon_fatal_break_multiplier". The chance to trigger "Fatal Break" is equal to "weapon chance * fatal break multiplier". For example, if you set smg chance to 10 (10%) & "weapon_fatal_break_multiplier" to 0.2, you'll get 10% chance of "Normal Break" & 2% chance of "Fatal Break" on each shot,

  • There's "Full Repair" feature when survivor holds "E (Use) + RELOAD" combination keys. A notification about the time left until the "Full Repair" finishes will show up. If these combo keys are released before the timer reaches 0, the "Full Repair" will be cancelled & reset back to the full duration. "Full Repair" will decrease "Weapon Break Level" to one level, & this can't be spammed. It means that after fixing, you need to get your gun jammed first before you can do "Full Repair" again.

  • When "Weapon Break Level 4" happens, the final results of the weapon break depend on the value set on "weapon_break_type". If it's set to 0, primary gun will lose all ammo (ammo clip + reserve ammo) & pistol will have the ammo clip locked to 1 (you'll only have 1 ammo clip on each reload). This state can be restored by picking ammo piles. If "weapon_break_type" is set to 1, triggering this Level 4 will result in complete destruction of the gun. Even pistol will be removed from inventory (if you use this mode, it's recommended to disable pistol break chance so you won't lose both guns & become a punching bag for zombies :D ).

  • When "weapon_break_user" is set to allow bots to have their guns broken, bots will automatically repair their jammed guns on each "Weapon Break" triggered, but they can't do "Full Repair", for now. Maybe I'll update this later to make bots do automatic "Full Repair" as they can't press "E + RELOAD".


So, with this mod, you'll get another new challenge in fighting zombies, as now your guns have durability.


NOTES:
  • A video preview & animated previews will be added later.
17 Comments
Big_Cheese_5 14 Mar @ 11:20pm 
This is promising script, i will put it on after beating L4D1 Campaign
I'm doing this scripts for L4D2 Crew only to increase the difficulty
Since i use melee weapon to break since its too op for 18,000 tank health, so i want the Tank bots to have a better chance to kill us with the Survivor bots weapons to break.
I'll give a feedback within between 1- 2 weeks after beating L4D2 Crew Campaign
kurochama  [author] 3 Feb @ 5:44am 
@Demo , you can explain it via chat later. Or you can also open a new thread on "Modding/ Mapping", as I also visit there quite often.
Demo 2 Feb @ 3:37pm 
If you add me I'll explain it. It shouldn't be anything outlandishly complicated.
kurochama  [author] 2 Feb @ 3:09pm 
@Demo , I don't, for now. But I can take requests as long as it's about a fun feature or mod that's still within my vscript knowledge.
Demo 2 Feb @ 12:42pm 
@kurochama

Do you take commissions for vscripts? 👀
kurochama  [author] 1 Feb @ 2:00am 
@SalaaMohamed05 , for dodge, you can try to check here: https://gtm.steamproxy.vip/app/550/discussions/0/599642060902898701/?ctp=4
The thread owner there has a video with a feature of rolling dodge. If it's a sliding dodge to slide forward & backward in simpler way when pressing certain combination keys, probably I can make it.
As for buffs when taunting, that should be possible, but it might need more tests.
SalaaMohamed05 1 Feb @ 1:10am 
mmm ok i have 2 suggestion the taunt every time you use taunt vocalizer voiceline you get fair buff like recover 2 health and increase max health for +10 for 20 second but cooldown is 2 minutes like 120 second and add notification that let you know you can use taunt and second suggestion is maybe dodge or dash like if you press any key or something like that you will dash or dodge at movement you hold like D key u dodge right and get iframe and if you perfect dodge you get slight buff like very slight damage buff and speed you can add options to disable iframe and taunt and more im bad suggestion sometime
kurochama  [author] 1 Feb @ 1:05am 
@SalaaMohamed05 , I'm open to suggestions, so feel free to tell me if you have anything in mind.
SalaaMohamed05 1 Feb @ 12:23am 
oh thanks but i have another suggestion if u want hear it
kurochama  [author] 1 Feb @ 12:15am 
@SalaaMohamed05 , actually my "Super Gore Shove" mod has a similar feature like "parry", as it can cancel some special infected's abilities if the pushback feature is applied when the survivor is looking at the special infected & the special infected is shoved in shove radius. So probably parry system is also possible to be made.