Major update, remove the hacks, use builtin overrides

This commit is contained in:
ineed bots 2023-12-16 22:42:26 -06:00
parent 29e4840450
commit 47acce3f7e
6 changed files with 376 additions and 347 deletions

View File

@ -1,7 +1,7 @@
![GitHub Logo](/bw-assets/bw-logo.png)
# T5 Bot Warfare
Bot Warfare is a GSC mod for [Black Ops 1](https://store.steampowered.com/app/42700/Call_of_Duty_Black_Ops/) and [PlutoniumT5](https://plutonium.pw/).
Bot Warfare is a GSC mod for [PlutoniumT5](https://plutonium.pw/).
It aims to extend the existing AI in the multiplayer games of Black Ops 1.

View File

@ -166,20 +166,6 @@ bot_give_loadout()
self setOffhandSecondaryClass( self.pers["bot"]["class_tacticle"] );
}
self thread fixSecondarySwitch( weap );
}
/*
Fixes the weapon on spawn for the bot
*/
fixSecondarySwitch( weap )
{
self endon( "death" );
self endon( "disconnect" );
self switchToWeapon( weap );
self setSpawnWeapon( weap );
wait 0.05;
self switchToWeapon( weap );
self setSpawnWeapon( weap );
}

File diff suppressed because it is too large Load Diff

View File

@ -351,12 +351,99 @@ isWeaponAltmode( weap )
return false;
}
/*
Bot will change to angles with speed
*/
bot_lookat( pos, time, vel, doAimPredict )
{
self notify( "bots_aim_overlap" );
self endon( "bots_aim_overlap" );
self endon( "disconnect" );
self endon( "death" );
self endon( "spawned_player" );
level endon ( "game_ended" );
if ( level.gameEnded || level.inPrematchPeriod || self BotIsFrozen() || !getDvarInt( "bots_play_aim" ) )
return;
if ( !isDefined( pos ) )
return;
if ( !isDefined( doAimPredict ) )
doAimPredict = false;
if ( !isDefined( time ) )
time = 0.05;
if ( !isDefined( vel ) )
vel = ( 0, 0, 0 );
steps = int( time * 20 );
if ( steps < 1 )
steps = 1;
myEye = self GetEye(); // get our eye pos
if ( doAimPredict )
{
myEye += ( self getVelocity() * 0.05 ) * ( steps - 1 ); // account for our velocity
pos += ( vel * 0.05 ) * ( steps - 1 ); // add the velocity vector
}
myAngle = self getPlayerAngles();
angles = VectorToAngles( ( pos - myEye ) - anglesToForward( myAngle ) );
X = AngleClamp180( angles[0] - myAngle[0] );
X = X / steps;
Y = AngleClamp180( angles[1] - myAngle[1] );
Y = Y / steps;
for ( i = 0; i < steps; i++ )
{
myAngle = ( AngleClamp180( myAngle[0] + X ), AngleClamp180( myAngle[1] + Y ), 0 );
self setPlayerAngles( myAngle );
wait 0.05;
}
}
/*
Includes altmode weapons
*/
getweaponslistall()
{
weaps = self getweaponslist();
for ( i = 0; i < weaps.size; i++ )
{
weap = weaps[i];
toks = strTok( weap, "_" );
if ( isSubStr( weap, "_gl_" ) )
{
weaps[weaps.size] = "gl_" + toks[0] + "_mp";
}
else if ( isSubStr( weap, "_ft_" ) )
{
weaps[weaps.size] = "ft_" + toks[0] + "_mp";
}
else if ( isSubStr( weap, "_mk_" ) )
{
weaps[weaps.size] = "mk_" + toks[0] + "_mp";
}
}
return weaps;
}
/*
Returns a valid grenade launcher weapon
*/
getValidTube()
{
weaps = self getweaponslist();
weaps = self getweaponslistall();
for ( i = 0; i < weaps.size; i++ )
{
@ -562,10 +649,49 @@ ClearBotGoal()
self notify( "new_goal" );
}
/*
Presses the use button
*/
BotPressUse( time )
{
self PressUseButton( time );
}
/*
Freeze controls
*/
BotFreezeControls( what )
{
self freeze_player_controls( what );
}
/*
Bot is frozen
*/
BotIsFrozen()
{
return false;
}
/*
Bot stops moving
*/
BotStopMove( what )
{
self thread botStopMove2( what );
}
/*
Sets the stance
*/
BotSetStance( what )
{
}
/*
Freezes bot in place
*/
botStopMove( what )
botStopMove2( what )
{
self endon( "disconnect" );
self endon( "death" );

View File

@ -743,8 +743,6 @@ add_bot()
if ( isdefined( bot ) )
{
bot.pers["isBot"] = true;
bot.equipment_enabled = true;
bot.pers[ "bot_perk" ] = true;
bot.pers["isBotWarfare"] = true;
bot thread maps\mp\bots\_bot_script::added();
}

View File

@ -84,10 +84,10 @@ do_botclearaimoverride()
do_botmeleeparams( yaw, dist )
{
// self botMeleeParams( yaw, dist );
self botMeleeParams( yaw, dist );
}
do_clearbotmeleeparams()
{
// self botClearMeleeParams();
self botClearMeleeParams();
}