mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-23 10:45:44 +00:00
Added bot_aim dvar
This commit is contained in:
parent
ca9dad8b79
commit
79592e6056
@ -29,6 +29,9 @@ init()
|
|||||||
if ( getDvar( "bots_main_waitForHostTime" ) == "" )
|
if ( getDvar( "bots_main_waitForHostTime" ) == "" )
|
||||||
setDvar( "bots_main_waitForHostTime", 10.0 ); //how long to wait to wait for the host player
|
setDvar( "bots_main_waitForHostTime", 10.0 ); //how long to wait to wait for the host player
|
||||||
|
|
||||||
|
if ( getDvar( "bots_main_kickBotsAtEnd" ) == "" )
|
||||||
|
setDvar( "bots_main_kickBotsAtEnd", false ); //kicks the bots at game end
|
||||||
|
|
||||||
if ( getDvar( "bots_manage_add" ) == "" )
|
if ( getDvar( "bots_manage_add" ) == "" )
|
||||||
setDvar( "bots_manage_add", 0 ); //amount of bots to add to the game
|
setDvar( "bots_manage_add", 0 ); //amount of bots to add to the game
|
||||||
|
|
||||||
@ -113,6 +116,9 @@ init()
|
|||||||
if ( getDvar( "bots_play_ads" ) == "" ) //bot ads
|
if ( getDvar( "bots_play_ads" ) == "" ) //bot ads
|
||||||
setDvar( "bots_play_ads", true );
|
setDvar( "bots_play_ads", true );
|
||||||
|
|
||||||
|
if ( getDvar( "bots_play_aim" ) == "" )
|
||||||
|
setDvar( "bots_play_aim", true );
|
||||||
|
|
||||||
if ( !isDefined( game["botWarfare"] ) )
|
if ( !isDefined( game["botWarfare"] ) )
|
||||||
game["botWarfare"] = true;
|
game["botWarfare"] = true;
|
||||||
|
|
||||||
@ -182,6 +188,11 @@ handleBots()
|
|||||||
wait 0.05;
|
wait 0.05;
|
||||||
|
|
||||||
setDvar( "bots_manage_add", getBotArray().size );
|
setDvar( "bots_manage_add", getBotArray().size );
|
||||||
|
|
||||||
|
if ( !getDvarInt( "bots_main_kickBotsAtEnd" ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
removeAllTestClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1302,7 +1302,9 @@ aim_loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( getDvarInt( "bots_play_aim" ) )
|
||||||
self botLookAt( last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset ), aimspeed );
|
self botLookAt( last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset ), aimspeed );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1324,11 +1326,14 @@ aim_loop()
|
|||||||
|
|
||||||
conedot = getConeDot( aimpos, eyePos, angles );
|
conedot = getConeDot( aimpos, eyePos, angles );
|
||||||
|
|
||||||
|
if ( getDvarInt( "bots_play_aim" ) )
|
||||||
|
{
|
||||||
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 )
|
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 )
|
||||||
self botLookAtPlayer( target, bone );
|
self botLookAtPlayer( target, bone );
|
||||||
else
|
else
|
||||||
self botLookAt( aimpos, aimspeed );
|
self botLookAt( aimpos, aimspeed );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aimpos = target.origin;
|
aimpos = target.origin;
|
||||||
@ -1338,6 +1343,7 @@ aim_loop()
|
|||||||
|
|
||||||
conedot = getConeDot( aimpos, eyePos, angles );
|
conedot = getConeDot( aimpos, eyePos, angles );
|
||||||
|
|
||||||
|
if ( getDvarInt( "bots_play_aim" ) )
|
||||||
self botLookAt( aimpos, aimspeed );
|
self botLookAt( aimpos, aimspeed );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1397,6 +1403,7 @@ aim_loop()
|
|||||||
aimpos = last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset );
|
aimpos = last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset );
|
||||||
conedot = getConeDot( aimpos, eyePos, angles );
|
conedot = getConeDot( aimpos, eyePos, angles );
|
||||||
|
|
||||||
|
if ( getDvarInt( "bots_play_aim" ) )
|
||||||
self botLookAt( aimpos, aimspeed );
|
self botLookAt( aimpos, aimspeed );
|
||||||
|
|
||||||
if ( !self canFire( curweap ) || !self isInRange( dist, curweap ) )
|
if ( !self canFire( curweap ) || !self isInRange( dist, curweap ) )
|
||||||
@ -1430,10 +1437,12 @@ aim_loop()
|
|||||||
{
|
{
|
||||||
forwardPos = anglesToForward( level.waypoints[self.bot.next_wp].angles ) * 1024;
|
forwardPos = anglesToForward( level.waypoints[self.bot.next_wp].angles ) * 1024;
|
||||||
|
|
||||||
|
if ( getDvarInt( "bots_play_aim" ) )
|
||||||
self botLookAt( eyePos + forwardPos, aimspeed );
|
self botLookAt( eyePos + forwardPos, aimspeed );
|
||||||
}
|
}
|
||||||
else if ( isDefined( self.bot.script_aimpos ) )
|
else if ( isDefined( self.bot.script_aimpos ) )
|
||||||
{
|
{
|
||||||
|
if ( getDvarInt( "bots_play_aim" ) )
|
||||||
self botLookAt( self.bot.script_aimpos, aimspeed );
|
self botLookAt( self.bot.script_aimpos, aimspeed );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1445,7 +1454,7 @@ aim_loop()
|
|||||||
else if ( isDefined( self.bot.towards_goal ) )
|
else if ( isDefined( self.bot.towards_goal ) )
|
||||||
lookat = self.bot.towards_goal;
|
lookat = self.bot.towards_goal;
|
||||||
|
|
||||||
if ( isDefined( lookat ) )
|
if ( isDefined( lookat ) && getDvarInt( "bots_play_aim" ) )
|
||||||
self botLookAt( lookat + ( 0, 0, self getEyeHeight() ), aimspeed );
|
self botLookAt( lookat + ( 0, 0, self getEyeHeight() ), aimspeed );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user