AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Balancer Spawn Infected (https://forums.alliedmods.net/showthread.php?t=323400)

xZk 04-18-2020 16:02

[L4D2] Balancer Spawn Infected
 
5 Attachment(s)
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 Attachment 181095 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

L4D2Noob 04-19-2020 07:32

Re: [L4D2]Balancer Spawn Special Infected
 
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.

xZk 04-19-2020 18:02

Re: [L4D2]Balancer Spawn Special Infected
 
thanks you for you report L4D2Noob, now that error should happen

L4D2Noob 04-19-2020 20:25

Re: [L4D2]Balancer Spawn Special Infected
 
Quote:

Originally Posted by xZk (Post 2694672)
thanks you for you report L4D2Noob, now that error should happen

Thank you very much!

Sout12 06-20-2020 03:20

Re: [L4D2] Balancer Spawn Infected
 
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 ?

xZk 06-20-2020 22:26

Re: [L4D2] Balancer Spawn Infected
 
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?

Sout12 06-21-2020 02:15

Re: [L4D2] Balancer Spawn Infected
 
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.

Dragokas 06-21-2020 13:35

Re: [L4D2] Balancer Spawn Infected
 
Thanks, very useful !

xZk 06-21-2020 14:37

Re: [L4D2] Balancer Spawn Infected
 
Quote:

Originally Posted by Sout12 (Post 2706652)
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"

Sout12 06-21-2020 18:39

Re: [L4D2] Balancer Spawn Infected
 
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


All times are GMT -4. The time now is 19:25.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.