Compare commits

..

5 Commits

Author SHA1 Message Date
d22af0209a wait for notifies 2024-10-22 10:01:40 -06:00
5ea5f77213 we are not released 2024-09-21 20:52:41 -06:00
3ee5453c87 add bots_manage_fill_watchplayers 2024-05-16 19:29:08 -06:00
9c0e3e26cd update 2024-04-30 13:12:18 -06:00
764a12dc7f small update 2024-04-30 12:43:16 -06:00
4 changed files with 62 additions and 15 deletions

View File

@ -7,7 +7,7 @@
*/
init()
{
level.bw_version = "2.2.0 PR 1";
level.bw_version = "2.3.0 PR 1";
if ( getdvar( "bots_main" ) == "" )
{
@ -67,6 +67,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" ) == "" )
{
setdvar( "bots_skill", 0 ); // 0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
@ -364,10 +369,10 @@ connected()
level.bots[ level.bots.size ] = self;
self thread onDisconnect();
level notify( "bot_connected", self );
self thread watchBotDebugEvent();
waittillframeend; // wait for waittills to process
level notify( "bot_connected", self );
}
/*
@ -583,6 +588,14 @@ addBots_loop()
}
}
if ( !randomint( 999 ) )
{
setdvar( "testclients_doreload", true );
wait 0.1;
setdvar( "testclients_doreload", false );
// doExtraCheck();
}
amount = bots;
if ( fillMode == 0 || fillMode == 2 )
@ -590,17 +603,34 @@ addBots_loop()
amount += players;
}
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 ) )
{
BotBuiltinCmdExec( "clientkick " + tempBot getentitynumber() );
BotBuiltinCmdExec( "clientkick " + tempBot getentitynumber() + " EXE_PLAYERKICKED" );
wait 0.25;
}
}
}
}

View File

@ -830,7 +830,7 @@ bot_lookat( pos, time, vel, doAimPredict )
for ( i = 0; i < steps; i++ )
{
myAngle = ( angleclamp180( myAngle[ 0 ] + X ), angleclamp180( myAngle[ 1 ] + Y ), 0 );
self setplayerangles( myAngle );
self BotBuiltinBotAngles( myAngle );
wait 0.05;
}
}
@ -1477,7 +1477,7 @@ aim_loop()
{
self thread bot_lookat( target gettagorigin( "j_spine4" ), 0.05 );
}
else if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 )
else if ( !nadeAimOffset && conedot > 0.999995 && lengthsquared( aimoffset ) < 0.05 )
{
self thread bot_lookat( aimpos, 0.05 );
}
@ -1495,7 +1495,7 @@ aim_loop()
conedot = getConeDot( aimpos, eyePos, angles );
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 )
if ( !nadeAimOffset && conedot > 0.999995 && lengthsquared( aimoffset ) < 0.05 )
{
self thread bot_lookat( aimpos, 0.05 );
}

View File

@ -85,8 +85,18 @@ BotBuiltinBotMeleeParams( yaw, dist )
}
/*
Test if is a bot
Sets angles
*/
BotBuiltinBotAngles( angles )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "botangles" ] ) )
{
self [[ level.bot_builtins[ "botangles" ] ]]( angles );
}
}
/*
Test if is a bot
*/
BotBuiltinIsBot()
{

View File

@ -5,6 +5,7 @@ init()
level.bot_builtins[ "botstop" ] = ::do_botstop;
level.bot_builtins[ "botmovement" ] = ::do_botmovement;
level.bot_builtins[ "botmeleeparams" ] = ::do_botmeleeparams;
level.bot_builtins[ "botangles" ] = ::do_botangles;
level.bot_builtins[ "isbot" ] = ::do_isbot;
level.bot_builtins[ "generatepath" ] = ::do_generatepath;
level.bot_builtins[ "getfunction" ] = ::do_getfunction;
@ -46,6 +47,12 @@ do_botmeleeparams( yaw, dist )
self botmeleeparams( yaw, dist );
}
do_botangles( angles )
{
self setplayerangles( angles );
// self botangles( angles[ 0 ], angles[ 1 ], angles[ 2 ] );
}
do_isbot()
{
return self isbot();