Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Apr 30, 2024
1 parent 746e106 commit f0eeda9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
12 changes: 6 additions & 6 deletions maps/mp/bots/_bot.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ fixPerksAndScriptKick()
onDisconnectPlayer()
{
name = self.name;

self waittill( "disconnect" );
waittillframeend;

Expand Down Expand Up @@ -1014,11 +1014,11 @@ addBots_loop()
if ( fillMode == 0 || fillMode == 2 )
{
amount += players;
}

if ( getdvarint( "bots_manage_fill_spec" ) )
{
amount += spec;
if ( getdvarint( "bots_manage_fill_spec" ) )
{
amount += spec;
}
}

if ( amount < fillAmount )
Expand Down
8 changes: 4 additions & 4 deletions maps/mp/bots/_bot_internal.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,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 );
}
Expand All @@ -1646,7 +1646,7 @@ aim_loop()

conedot = getConeDot( aimpos, eyePos, angles );

if ( ( isdefined( self.bot.knifing_target ) && self.bot.knifing_target == target ) || ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 ) )
if ( ( isdefined( self.bot.knifing_target ) && self.bot.knifing_target == target ) || ( !nadeAimOffset && conedot > 0.999995 && lengthsquared( aimoffset ) < 0.05 ) )
{
self thread bot_lookat( aimpos, 0.05 );
}
Expand All @@ -1664,7 +1664,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 );
}
Expand Down Expand Up @@ -2940,7 +2940,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;
}
}
6 changes: 6 additions & 0 deletions maps/mp/bots/_bot_script.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -3010,6 +3010,12 @@ bot_killstreak_think_loop()
{
curWeap = self getcurrentweapon();

if ( curWeap == "radar_mp" || curWeap == "dogs_mp" || curWeap == "artillery_mp" )
{
self thread changeToWeapon( self.lastdroppableweapon );
return;
}

if ( curWeap == "none" || !isWeaponDroppable( curWeap ) )
{
curWeap = self.lastdroppableweapon;
Expand Down
11 changes: 11 additions & 0 deletions maps/mp/bots/_bot_utility.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ BotBuiltinBotMeleeParams( yaw, dist )
}
}

/*
Sets angles
*/
BotBuiltinBotAngles( angles )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "botangles" ] ) )
{
self [[ level.bot_builtins[ "botangles" ] ]]( angles );
}
}

/*
Returns if player is the host
*/
Expand Down
7 changes: 7 additions & 0 deletions scripts/mp/bots_adapter_pt4.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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;
}

Expand Down Expand Up @@ -54,6 +55,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();
Expand Down

0 comments on commit f0eeda9

Please sign in to comment.