Left 4 Dead 2

Left 4 Dead 2

View Stats:
Miolant Oct 25, 2023 @ 11:21am
Mounted guns ammo limitation.
Hello. Is even possible the script which limiting amount of ammunition for mounted guns at 100 rounds? Or at least prevents of using them after 100 shots?

Also is there a way to remove triple increase of Uncommon Infecteds' health?

Thanks in advance.
< >
Showing 1-8 of 8 comments
Evil Oct 30, 2023 @ 9:41am 
Just my two cents, but that particular weapon doesn't function like other weapons. It's more like a charge shot weapon, where once fully charged it becomes disabled. Which means it doesn't count how many shots come out of it, but how long it's been charging. You can come up with a work around by changing these cvar:

mounted_gun_cooldown_time : 60 : , "cheat", "rep", "cl" : Mounted gun cooldown time
mounted_gun_mount_cooldown_time : 0.5 : , "sv", "cheat" :
mounted_gun_overheat_penalty_time : 60 : , "sv", "cheat" :
mounted_gun_overheat_time : 15 : , "cheat", "rep", "cl" : Mouted gun overheat time
mounted_gun_rate_of_fire : 8 : , "sv", "cheat" :

With this; I'd think you could go this route:

mounted_gun_cooldown_time 9999
mounted_gun_overheat_penalty_time 9999
mounted_gun_overheat_time 12

In theory this would only allow the weapon to fire around 100 bullets total before becoming permanently disabled (unless players are still around it after the excessive cool down time anyways). Seems like there should be a method to count how many times it's firing using a vscript but I think that would lead to undesired results honestly.
Miolant Nov 4, 2023 @ 7:17am 
Thanks a lot. It works in cause of uninterrapted fire only, but ♥♥♥♥♥♥♥♥♥ machine gun is cooling in every break of shooting that potentially leads to unlimited using. But also, maybe exists the way to remove M2 from any campaigns except The Passing (which is used by Louis)?
Evil Nov 4, 2023 @ 8:30am 
In that case you could try this. I don't have time to test this before work so let me know what happens when you try it.

SessionState <- { KillMountedGuns = false } function OnGameEvent_round_start_post_nav( params ) { if ( Director.GetMapName() == "c6m1_riverbank" | "c6m2_bedlam" | "c6m3_port" ) SessionState.KillMountedGuns = false; else SessionState.KillMountedGuns = true; } function KillMountedGuns() { local mountedgun = null; while ( mountedgun = Entities.FindByModel( mountedgun, "models/w_models/weapons/50cal.mdl" ) ) mountedgun.Kill(); local minigun = null; while ( minigun = Entities.FindByModel( minigun, "models/w_models/weapons/w_minigun.mdl" ) ) minigun.Kill(); }

You might need to change the break between the map names to commas. You also might want to remove one of the guns, I included both in case you wanted to kill both.
Miolant Nov 4, 2023 @ 10:55am 
Thanks. C6M3 enough, I guess, M2 appears there only. Unfortunately I used OnGameEvent_round_start_post_nav function for removing some melees (and minigun). Maybe it will work in separate script. Anyway testing may takes some time.
Last edited by Miolant; Nov 5, 2023 @ 7:23am
Miolant Nov 5, 2023 @ 7:23am 
Unfortunately does not work. Don't know locally or itself. Thanks anyway. I think I should skip this issue.
R󠀡F Nov 6, 2023 @ 2:02am 
Convars.SetValue( "mounted_gun_cooldown_time", 99999);
Convars.SetValue( "mounted_gun_overheat_penalty_time", 99999);
Convars.SetValue( "mounted_gun_overheat_time", 12);
Convars.SetValue( "z_minigun_cooldown_time", 99999);
Convars.SetValue( "z_minigun_overheat_time", 12);

Works just fine in my end, and no, it doesn't cool down between shots. (unless you're actually willing to wait 99999 seconds)

EDIT: Does not seem to work for Minigun actually since the game limits the cooldown time for it at 100. But 50cal seems to work fine. You would need to use Sourcemod to remove the cvar cap.
Last edited by R󠀡F; Nov 6, 2023 @ 2:11am
R󠀡F Nov 6, 2023 @ 3:28am 
You can try this.
https://pastebin.com/0mE0zJKa

Max ammo can be controlled with the unused "ammo_turret_max" and "ammo_minigun_max" cvars.
Miolant Nov 6, 2023 @ 5:53am 
Thanks a lot. Sorry again about my rudeness. All the best.
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Oct 25, 2023 @ 11:21am
Posts: 8