Raised This Month: $2 Target: $400
 0% 

[L4D2] Balancer Spawn Infected


Post New Thread Reply   
 
Thread Tools Display Modes
Author
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Plugin ID:
7048
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
13 
Plugin Description:
Balances the spawn of Infected, depending on the number of Survivor players in game
Old 04-18-2020 , 16:02   [L4D2] Balancer Spawn Infected
Reply With Quote #1

The plugin will try to balance the infected limit and interval spawn of the special infected, depending on the number of survivor players in the game.
This is accomplished by editing the Director Scripts through one of these 3 methods
  • Changing only the variables Base DirectorOptions table(*).
  • Changing the variables Script Scope Director Script(*).
  • Changing the variables Director Script by forward(*).

This plugin is inspired by [L4D, L4D2] Common Infected Regulator and [L4D2] Director Settings Loader

Cvars:
PHP Code:
// 0: Disable, 1: Enable Plugin
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
balancer_spawn "1"

// 0: Edit only director, 1: Override director and vscripts, 2: Override forward director scripts(require left4dhooks)
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "2.000000"
balancer_spawn_mode "0"

// 0: Check all players survivor, 1: Not check survivor bots, 2: Not check survivors dead, 3: Select all Not check modes
// -
// Default: "2"
// Minimum: "0.000000"
// Maximum: "3.000000"
balancer_spawn_check "2"

// Set survivor players base config
// -
// Default: "4"
// Minimum: "1.000000"
balancer_spawn_check_base "4"

// Set limit specials to players base config, -1:Disable limit balancer
// -
// Default: "4"
// Minimum: "-1.000000"
balancer_spawn_limit_si_base "4"

// Set limit to decrease for each 1 player less than players base config, -1:Disable limit decrement
// -
// Default: "1"
balancer_spawn_limit_si_dec "1"

// Set limit to increase for each 1 player more than players base config, -1:Disable limit increment
// -
// Default: "1"
balancer_spawn_limit_si_inc "1"

// Set max limit for all special infected, -1:Disable limit max
// -
// Default: "-1"
balancer_spawn_limit_si_max "-1"

// Set min limit for all special infected, -1:Disable limit min
// -
// Default: "1"
balancer_spawn_limit_si_min "1"

// Set interval special respawn for players base config, -1:Disable interval balancer
// -
// Default: "45.0"
// Minimum: "-1.000000"
balancer_spawn_interval_si_base "45.0"

// Set interval to decrease for each 1 player less than players base config, 0:Disable interval decrement
// -
// Default: "0.0"
balancer_spawn_interval_si_dec "0.0"

// Set interval to increase for each 1 player more than players base config, 0:Disable interval increment
// -
// Default: "-5.0"
balancer_spawn_interval_si_inc "-5.0"

// Set max interval respawn for all special infected, -1:Disable interval max
// -
// Default: "60.0"
balancer_spawn_interval_si_max "60.0"

// Set min interval respawn for all special infected, -1:Disable interval min
// -
// Default: "3.0"
balancer_spawn_interval_si_min "3.0" 
CFG Infected Limit:
PHP Code:
//"-1": Disable config value
"InfectedLimit"
{
    
"CommonLimit"
    
{
        
"base"            "30"//set amount base infecteds commons for amount survivors checkeds equals in cvar(balancer_spawn_check_base)
        
"decrement"        "5"//set infecteds commons amount to decrease for each survivor less in the check base(balancer_spawn_check_base)
        
"increment"        "5"//set infecteds commons amount to increase for each survivor more in the check base(balancer_spawn_check_base)
        
"minimun"                "10"//sets the minimum amount of common infected allowed
        
"maximun"        "50"//sets the maximun amount of common infected allowed
    
}
    
"SmokerLimit"
    
{
        
"base"            "1"
        "decrement"        "-1"
        "increment"        "1"
        "minimun"                "1"
        "maximun"        "4"
    
}
    
"BoomerLimit"
    
{
        
"base"            "1"
        "decrement"        "-1"
        "increment"        "1"
        "minimun"                "1"
        "maximun"        "4"
    
}
     
"HunterLimit"
    
{
        
"base"            "1"
        "decrement"        "-1"
        "increment"        "1"
        "minimun"                "1"
        "maximun"        "4"
    
}
    
"SpitterLimit"
    
{
        
"base"            "1"
        "decrement"        "-1"
        "increment"        "1"
        "minimun"                "1"
          "maximun"        "4"
    
}
     
"JockeyLimit"
    
{
        
"base"            "1"
        "decrement"        "-1"
        "increment"        "1"
        "minimun"                "1"
        "maximun"        "4"
    
}
     
"ChargerLimit"
    
{
        
"base"            "1"
        "decrement"        "-1"
        "increment"        "1"
        "minimun"                "1"
        "maximun"        "4"
    
}
    
"WitchLimit"
    
{
        
"base"            "-1"
        "decrement"        "-1"
        "increment"        "-1"
        "minimun"                "-1"
        "maximun"        "-1"
    
}
    
"TankLimit"
    
{
        
"base"            "-1"
        "decrement"        "-1"
        "increment"        "-1"
        "minimun"                "-1"
        "maximun"        "-1"
    
}

Admin Commands:
PHP Code:
"sm_bs_reload" //reload config infected limit 
Requirements
-[L4D & L4D2] Left 4 DHooks Direct(optional)
Notes:
Rant:
-put l4d2_balancer_spawn_infectedlimit.cfg in "/addons/sourcemod/data/" folder if this file is not autocreated.
-the configs "TankLimit" and "WitchLimit" only allows more tanks and witches to spawn simultaneously, it will not spawn these.
-if config key "base" is set to "-1" or is commented, all settings for your class will be disabled.


Changelog


credits
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_balancer_spawn.sp - 161 views - 16.1 KB)

Last edited by xZk; 05-10-2020 at 21:22. Reason: v1.1
xZk is offline
L4D2Noob
Junior Member
Join Date: Mar 2020
Location: Moscow
Old 04-19-2020 , 07:32   Re: [L4D2]Balancer Spawn Special Infected
Reply With Quote #2

Code:
L 04/19/2020 - 09:25:24: [SM] Exception reported: Invalid entity index -2076238729
L 04/19/2020 - 09:25:24: [SM] Blaming: l4d2_balancer_spawn.smx
L 04/19/2020 - 09:25:24: [SM] Call stack trace:
L 04/19/2020 - 09:25:24: [SM]   [0] EntIndexToEntRef
L 04/19/2020 - 09:25:24: [SM]   [1] Line 252, l4d2_balancer_spawn.sp::OnGameplayStart
I don’t know if this is critical or not. But in logs such records are created.
__________________
L4D2Noob is offline
Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 04-19-2020 , 18:02   Re: [L4D2]Balancer Spawn Special Infected
Reply With Quote #3

thanks you for you report L4D2Noob, now that error should happen
xZk is offline
L4D2Noob
Junior Member
Join Date: Mar 2020
Location: Moscow
Old 04-19-2020 , 20:25   Re: [L4D2]Balancer Spawn Special Infected
Reply With Quote #4

Quote:
Originally Posted by xZk View Post
thanks you for you report L4D2Noob, now that error should happen
Thank you very much!
__________________
L4D2Noob is offline
Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
Sout12
Member
Join Date: May 2017
Old 06-20-2020 , 03:20   Re: [L4D2] Balancer Spawn Infected
Reply With Quote #5

Thanks for this, after a few modifications seems to work perfect.

1 Question though, little confused about "balancer_spawn_check" i want it to spawn specials based on alive survivors, so what would i set it to?

Edit: It seems like after the first campaign specials are no longer spawning ?

Last edited by Sout12; 06-20-2020 at 16:28.
Sout12 is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 06-20-2020 , 22:26   Re: [L4D2] Balancer Spawn Infected
Reply With Quote #6

you must set that cvar to "2" (default value)
balancer_spawn_check "2"
0 = checking any survivors
1 = checking only human survivors
2 = checking only alive survivors
3 = 1 and 2

i'm sorry for my bad explanation of cvars, I still have mediocre English :c
Quote:
Edit: It seems like after the first campaign specials are no longer spawning ?
Can you give me more details about this, this happened,you mean what happens after the 1st map of each campaign?
xZk is offline
Sout12
Member
Join Date: May 2017
Old 06-21-2020 , 02:15   Re: [L4D2] Balancer Spawn Infected
Reply With Quote #7

Thanks for the reply, seems like when i start a campaign, the 2nd level sometimes spawns specials and sometimes no specials spawn at all, not sure if i have anything setup wrong.
Sout12 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 06-21-2020 , 13:35   Re: [L4D2] Balancer Spawn Infected
Reply With Quote #8

Thanks, very useful !
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 06-21-2020 , 14:37   Re: [L4D2] Balancer Spawn Infected
Reply With Quote #9

Quote:
Originally Posted by Sout12 View Post
seems like when i start a campaign, the 2nd level sometimes spawns specials and sometimes no specials spawn at all, not sure if i have anything setup wrong.
I'm not sure why that happens, but I think it's because some maps already have their own default spawn limits seated with their vscript file.
you'll try set this cvar: balancer_spawn_mode to "1" or "2"

Last edited by xZk; 06-21-2020 at 14:37.
xZk is offline
Sout12
Member
Join Date: May 2017
Old 06-21-2020 , 18:39   Re: [L4D2] Balancer Spawn Infected
Reply With Quote #10

I've tried to mess around with the "balancer_spawn_mode" cvar but still seems like specials are not spawning.

Its very strange sometimes a few would spawn then sometimes none at all

I do have 8 players in the game, but im guessing this plugin is for a 8 player coop, idk why its not working for me

Edit: I also did try to install Left4Hooks and set the cvar to 2 but still no specials

If it helps at all what does work for me is a plugin called "ABM" using the "abm_autohard" spawns specials just fine but i wanted it to spawn specials based on current alive survivors

Last edited by Sout12; 06-21-2020 at 18:52.
Sout12 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode