diff --git a/README.md b/README.md
index a98475f..67621e9 100644
--- a/README.md
+++ b/README.md
@@ -60,15 +60,17 @@ This mod extends the functionality and features of Combat Training in Black Ops
|----------------------------------|---------------------------------------------------------------------------------------------|--------------:|
| bots_main | Enable this mod. | 1 |
| bots_main_waitForHostTime | How many seconds to wait for the host player to connect before adding bots to the match. | 10 |
+| bots_main_debug | Enable bot event prints.
- `0` - disable
- `1` - for just debug events
- `2` - for every event
| 0 |
| bots_main_kickBotsAtEnd | Kick the bots at the end of a match. | 0 |
| bots_manage_add | Amount of bots to add to the game, once bots are added, resets back to `0`. | 0 |
| bots_manage_fill | Amount of players/bots (look at `bots_manage_fill_mode`) to maintain in the match. | 0 |
-| bots_manage_fill_mode | `bots_manage_fill` players/bots counting method.- `0` - counts both players and bots.
- `1` - only counts bots.
| 0 |
-| bots_manage_fill_kick | If the amount of players/bots in the match exceeds `bots_manage_fill`, kick bots until no longer exceeds. | 0 |
+| bots_manage_fill_mode | `bots_manage_fill` players/bots counting method.- `0` - counts both players and bots.
- `1` - only counts bots.
- `2` - exactly `0` but auto adjusts `bots_manage_fill` to map.
- `3` - exactly `1` but auto adjusts `bots_manage_fill` to map.
- `4` - bots are used for balancing teams.
- `5` - exactly `4` but auto adjusts `bots_manage_fill` to map.
| 0 |
+| bots_manage_fill_watchplayers | Bots will not be added until one player is in the game | 0 |
+| bots_manage_fill_kick | If the amount of players/bots in the match exceeds `bots_manage_fill`, kick bots until no longer exceeds. | 0 |
| bots_manage_fill_spec | If when counting players for `bots_manage_fill` should include spectators. | 1 |
| bots_team | One of `autoassign`, `allies`, `axis`, `spectator`, or `custom`. What team the bots should be on. | autoassign |
| bots_team_amount | When `bots_team` is set to `custom`. The amount of bots to be placed on the axis team. The remainder will be placed on the allies team. | 0 |
-| bots_team_force | If the server should force bots' teams according to the `bots_team` value. When `bots_team` is `autoassign`, unbalanced teams will be balanced. This dvar is ignored when `bots_team` is `custom`. | 0 |
+| bots_team_force | If the server should force bots' teams according to the `bots_team` value. When `bots_team` is `autoassign`, unbalanced teams will be balanced. This dvar is ignored when `bots_team` is `custom`. | 0 |
| bots_team_mode | When `bots_team_force` is `1` and `bots_team` is `autoassign`, players/bots counting method. - `0` - counts both players and bots.
- `1` - only counts bots
| 0 |
| bots_loadout_reasonable | If the bots should filter bad performing create-a-class selections. | 0 |
| bots_loadout_allow_op | If the bots should be able to use overpowered and annoying create-a-class selections. | 1 |
@@ -90,6 +92,8 @@ This mod extends the functionality and features of Combat Training in Black Ops
- v1.2.0 (not released yet)
- Bots can now melee lunge
- Bots can now jumpshot and dropshot
+ - Fixed bots_manage_fill_spec players being counted with bots_manage_fill_mode 1 (bot only)
+ - Added bots_manage_fill_watchplayers dvar
- Fix some script runtime errors
- Improved bots using altmode weapons
- Improved bots taking spyplanes down
diff --git a/maps/mp/gametypes/_bot.gsc b/maps/mp/gametypes/_bot.gsc
index c999b35..f2f7560 100644
--- a/maps/mp/gametypes/_bot.gsc
+++ b/maps/mp/gametypes/_bot.gsc
@@ -69,6 +69,11 @@ init()
setdvar( "bots_manage_fill_kick", false ); // kick bots if too many
}
+ if ( getdvar( "bots_manage_fill_watchplayers" ) == "" )
+ {
+ setdvar( "bots_manage_fill_watchplayers", false ); // add bots when player exists, kick if not
+ }
+
if ( getdvar( "bots_skill" ) == "" ) // alias for bot_difficulty
{
setdvar( "bots_skill", "" );
@@ -786,7 +791,7 @@ addBots_loop()
fillMode = getdvarint( "bots_manage_fill_mode" );
- if ( fillMode == 2 || fillMode == 3 )
+ if ( fillMode == 2 || fillMode == 3 || fillMode == 5 )
{
setdvar( "bots_manage_fill", getGoodMapAmount() );
}
@@ -796,6 +801,8 @@ addBots_loop()
players = 0;
bots = 0;
spec = 0;
+ axisplayers = 0;
+ alliesplayers = 0;
playercount = level.players.size;
@@ -819,29 +826,6 @@ addBots_loop()
else
{
players++;
- }
- }
-
- if ( fillMode == 4 )
- {
- axisplayers = 0;
- alliesplayers = 0;
-
- playercount = level.players.size;
-
- for ( i = 0; i < playercount; i++ )
- {
- player = level.players[ i ];
-
- if ( player is_bot() )
- {
- continue;
- }
-
- if ( !isdefined( player.pers[ "team" ] ) )
- {
- continue;
- }
if ( player.pers[ "team" ] == "axis" )
{
@@ -852,26 +836,11 @@ addBots_loop()
alliesplayers++;
}
}
-
- result = fillAmount - abs( axisplayers - alliesplayers ) + bots;
-
- if ( players == 0 )
- {
- if ( bots < fillAmount )
- {
- result = fillAmount - 1;
- }
- else if ( bots > fillAmount )
- {
- result = fillAmount + 1;
- }
- else
- {
- result = fillAmount;
- }
- }
-
- bots = result;
+ }
+
+ if ( getdvarint( "bots_manage_fill_spec" ) )
+ {
+ players += spec;
}
if ( !randomint( 999 ) )
@@ -887,24 +856,48 @@ addBots_loop()
if ( fillMode == 0 || fillMode == 2 )
{
amount += players;
+ }
+
+ // use bots as balance
+ if ( fillMode == 4 || fillMode == 5 )
+ {
+ diffPlayers = abs( alliesplayers - axisplayers );
+ amount = fillAmount - ( diffPlayers - bots );
- if ( getdvarint( "bots_manage_fill_spec" ) )
+ if ( players + diffPlayers < fillAmount )
{
- amount += spec;
+ amount = players + bots;
}
}
+ if ( players <= 0 && getdvarint( "bots_manage_fill_watchplayers" ) )
+ {
+ amount = fillAmount + bots;
+ }
+
if ( amount < fillAmount )
{
- setdvar( "bots_manage_add", 1 );
+ setdvar( "bots_manage_add", fillAmount - amount );
}
else if ( amount > fillAmount && getdvarint( "bots_manage_fill_kick" ) )
{
- tempBot = getBotToKick();
+ botsToKick = amount - fillAmount;
- if ( isdefined( tempBot ) )
+ if ( botsToKick > 64 )
{
- kick( tempBot getentitynumber(), "EXE_PLAYERKICKED" );
+ botsToKick = 64;
+ }
+
+ for ( i = 0; i < botsToKick; i++ )
+ {
+ tempBot = getBotToKick();
+
+ if ( isdefined( tempBot ) )
+ {
+ kick( tempBot getentitynumber(), "EXE_PLAYERKICKED" );
+
+ wait 0.25;
+ }
}
}
}