mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-20 17:55:42 +00:00
add bots_manage_fill_watchplayers
This commit is contained in:
parent
1f9c458c07
commit
87b2a1ca8b
12
README.md
12
README.md
@ -84,19 +84,20 @@ You can easily setup a local LAN dedicated server for you to join and play on. H
|
||||
| bots_main_GUIDs | A comma separated list of GUIDs of players who will be given host. | |
|
||||
| bots_main_waitForHostTime | How many seconds to wait for the host player to connect before adding bots to the match. | 10 |
|
||||
| bots_main_menu | Enable the in-game menu for hosts. | 1 |
|
||||
| bots_main_debug | Enable the in-game waypoint editor. | 0 |
|
||||
| bots_main_debug | Enable the in-game waypoint editor at start of the game, or enable bot event prints. <ul><li>`0` - disable</li><li>`1` - for just debug events</li><li>`2` - for every event</li><ul> | 0 |
|
||||
| bots_main_kickBotsAtEnd | Kick the bots at the end of a match. | 0 |
|
||||
| bots_main_chat | The rate bots will chat at, set to 0 to disable. | 1.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.<ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots.</li></ul> | 0 |
|
||||
| bots_manage_fill_mode | `bots_manage_fill` players/bots counting method.<ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots.</li><li>`2` - exactly `0` but auto adjusts `bots_manage_fill` to map.</li><li>`3` - exactly `1` but auto adjusts `bots_manage_fill` to map.</li><li>`4` - bots are used for balancing teams.</li><li>`5` - exactly `4` but auto adjusts `bots_manage_fill` to map.</li></ul> | 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_mode | When `bots_team_force` is `true` and `bots_team` is `autoassign`, players/bots counting method. <ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots</li></ul> | 0 |
|
||||
| bots_skill | Bots' difficulty.<ul><li>`0` - Random difficulty for each bot.</li><li>`1` - Easiest difficulty for all bots.</li><li>`2` to `6` - Between easy and hard difficulty for all bots.</li><li>`7` - The hardest difficulty for all bots.</li><li>`8` - custom (look at the `bots_skill_<team>_<difficulty>` dvars)</li></ul> | 0 |
|
||||
| bots_team_mode | When `bots_team_force` is `1` and `bots_team` is `autoassign`, players/bots counting method. <ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots</li></ul> | 0 |
|
||||
| bots_skill | Bots' difficulty.<ul><li>`0` - Random difficulty for each bot.</li><li>`1` - Easiest difficulty for all bots.</li><li>`2` to `6` - Between easy and hard difficulty for all bots.</li><li>`7` - The hardest difficulty for all bots.</li><li>`8` - custom (look at the `bots_skill_<team>_<difficulty>` dvars)</li><li>`9` - Every difficulty parameter is randomized</ul> | 0 |
|
||||
| bots_skill_axis_hard | When `bots_skill` is set to `8`, the amount of hard difficulty bots to set on the axis team. | 0 |
|
||||
| bots_skill_axis_med | When `bots_skill` is set to `8`, the amount of medium difficulty bots to set on the axis team. The remaining bots on the team will be set to easy difficulty. | 0 |
|
||||
| bots_skill_allies_hard | When `bots_skill` is set to `8`, the amount of hard difficulty bots to set on the allies team. | 0 |
|
||||
@ -123,6 +124,9 @@ You can easily setup a local LAN dedicated server for you to join and play on. H
|
||||
- v2.3.0 (not released yet)
|
||||
- Smoothed bot aim at range
|
||||
- Fixed bots_manage_fill_spec players being counted with bots_manage_fill_mode 1 (bot only)
|
||||
- Added bots_manage_fill_watchplayers dvar
|
||||
- Bots hop off turrets if they get stuck on one
|
||||
- Fixed script variable leak with opening and closing the in-game menu
|
||||
|
||||
- v2.2.0
|
||||
- Fixed some chat related script runtime errors
|
||||
|
@ -74,6 +74,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_team" ) == "" )
|
||||
{
|
||||
setdvar( "bots_team", "autoassign" ); // which team for bots to join
|
||||
@ -933,7 +938,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() );
|
||||
}
|
||||
@ -943,6 +948,8 @@ addBots_loop()
|
||||
players = 0;
|
||||
bots = 0;
|
||||
spec = 0;
|
||||
axisplayers = 0;
|
||||
alliesplayers = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
@ -961,37 +968,6 @@ addBots_loop()
|
||||
else
|
||||
{
|
||||
players++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !randomint( 999 ) )
|
||||
{
|
||||
setdvar( "testclients_doreload", true );
|
||||
wait 0.1;
|
||||
setdvar( "testclients_doreload", false );
|
||||
doExtraCheck();
|
||||
}
|
||||
|
||||
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" )
|
||||
{
|
||||
@ -1002,26 +978,19 @@ 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 ) )
|
||||
{
|
||||
setdvar( "testclients_doreload", true );
|
||||
wait 0.1;
|
||||
setdvar( "testclients_doreload", false );
|
||||
doExtraCheck();
|
||||
}
|
||||
|
||||
amount = bots;
|
||||
@ -1029,24 +998,48 @@ addBots_loop()
|
||||
if ( fillMode == 0 || fillMode == 2 )
|
||||
{
|
||||
amount += players;
|
||||
|
||||
if ( getdvarint( "bots_manage_fill_spec" ) )
|
||||
{
|
||||
amount += spec;
|
||||
}
|
||||
|
||||
// use bots as balance
|
||||
if ( fillMode == 4 || fillMode == 5 )
|
||||
{
|
||||
diffPlayers = abs( alliesplayers - axisplayers );
|
||||
amount = fillAmount - ( diffPlayers - bots );
|
||||
|
||||
if ( players + diffPlayers < fillAmount )
|
||||
{
|
||||
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" ) )
|
||||
{
|
||||
botsToKick = amount - fillAmount;
|
||||
|
||||
if ( botsToKick > 64 )
|
||||
{
|
||||
botsToKick = 64;
|
||||
}
|
||||
|
||||
for ( i = 0; i < botsToKick; i++ )
|
||||
{
|
||||
tempBot = getBotToKick();
|
||||
|
||||
if ( isdefined( tempBot ) )
|
||||
{
|
||||
kick( tempBot getentitynumber() );
|
||||
|
||||
wait 0.25;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -771,6 +771,10 @@ addOptions()
|
||||
_temp = "bots used as team balance";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_temp = "bots used as team balance, adjust to map";
|
||||
break;
|
||||
|
||||
default:
|
||||
_temp = "out of range";
|
||||
break;
|
||||
@ -1337,6 +1341,11 @@ man_bots( a, b )
|
||||
self iprintln( "bot_fill will now use bots as team balance." );
|
||||
break;
|
||||
|
||||
case 4:
|
||||
setdvar( "bots_manage_fill_mode", 5 );
|
||||
self iprintln( "bot_fill will now use bots as team balance, adjusting to map." );
|
||||
break;
|
||||
|
||||
default:
|
||||
setdvar( "bots_manage_fill_mode", 0 );
|
||||
self iprintln( "bot_fill will now count everyone." );
|
||||
|
Loading…
x
Reference in New Issue
Block a user