This commit is contained in:
ineed bots 2024-03-11 14:15:37 -06:00
parent e75ebddafa
commit 1b7b9242ae
4 changed files with 92 additions and 53 deletions

View File

@ -41,6 +41,9 @@ This mod extends the functionality and features of Combat Training in Black Ops
- Bots have a slight delay after spawning, scales inversely with difficulty. - Bots have a slight delay after spawning, scales inversely with difficulty.
- Bots can reroll carepackages. - Bots can reroll carepackages.
- Bots can use the valkyrie rocket carepackage streak. - Bots can use the valkyrie rocket carepackage streak.
- Bots can melee lunge.
- Bots can jumpshot and dropshot.
- Bots can use altmode weapons (gl, ft, mk)
## Installation ## Installation
0. Download the [latest release](https://github.com/ineedbots/t5_bot_warfare/releases) of Bot Warfare. 0. Download the [latest release](https://github.com/ineedbots/t5_bot_warfare/releases) of Bot Warfare.
@ -84,6 +87,14 @@ This mod extends the functionality and features of Combat Training in Black Ops
| bots_play_aim | If the bots can aim. | 1 | | bots_play_aim | If the bots can aim. | 1 |
## Changelog ## Changelog
- v1.2.0
- Bots can now melee lunge
- Bots can now jumpshot and dropshot
- Fix some script runtime errors
- Improved bots using altmode weapons
- Reduced variable usage
- Major cleanup
- v1.1.1 - v1.1.1
- Fixed some script runtime errors - Fixed some script runtime errors
- Improved domination - Improved domination

View File

@ -168,13 +168,14 @@ bot_on_spawn()
self waittill( "spawned_player" ); self waittill( "spawned_player" );
self BotBuiltinClearOverrides( true ); self BotBuiltinClearOverrides( true );
self BotBuiltinWeaponOverride( self getcurrentweapon() ); self BotBuiltinWeaponOverride( self getcurrentweapon() );
self.bot_is_doing_some_other_override = false;
self.bot_lock_goal = false; self.bot_lock_goal = false;
self.help_time = undefined; self.help_time = undefined;
self.bot_was_follow_script_update = undefined; self.bot_was_follow_script_update = undefined;
self.bot_attacking_plane = false; self.bot_attacking_plane = false;
// grenade c4 watcher // todo: grenade c4 watcher
self thread bot_spawn(); self thread bot_spawn();
} }
} }
@ -394,6 +395,7 @@ bot_spawn()
self thread bot_revive_think(); self thread bot_revive_think();
// todo:
// stockpile.gsc // stockpile.gsc
// hotel.gsc // hotel.gsc
// kowloon.gsc // kowloon.gsc
@ -423,7 +425,7 @@ bot_spawn()
self thread bot_uav_think(); self thread bot_uav_think();
self thread bot_weapon_think(); self thread bot_weapon_think();
// reload cancel // todo: reload cancel
self thread bot_listen_to_steps(); self thread bot_listen_to_steps();
self thread bot_revenge_think(); self thread bot_revenge_think();
self thread follow_target(); self thread follow_target();
@ -680,6 +682,7 @@ bot_wait_stop_move()
*/ */
BotUseRandomEquipment() BotUseRandomEquipment()
{ {
// todo
} }
/* /*
@ -687,6 +690,7 @@ BotUseRandomEquipment()
*/ */
BotLookAtRandomThing( obj_target ) BotLookAtRandomThing( obj_target )
{ {
// todo
} }
/* /*
@ -741,6 +745,7 @@ fire_c4()
for ( ;; ) for ( ;; )
{ {
// todo
// self thread BotPressAds( 0.05 ); // self thread BotPressAds( 0.05 );
wait 0.1; wait 0.1;
} }
@ -2477,13 +2482,20 @@ bot_plane_attack( plane )
self botStopMove( true ); self botStopMove( true );
self.bot_attacking_plane = true; self.bot_attacking_plane = true;
if ( self changeToWeapon( weap ) ) if ( !self.bot_is_doing_some_other_override )
{ {
self do_bot_plane_combat( plane, weap ); self.bot_is_doing_some_other_override = true;
self notify( "bots_aim_overlap" ); if ( self changeToWeapon( weap ) )
self BotBuiltinClearAimOverride(); {
self BotBuiltinClearButtonOverride( "ads" ); self do_bot_plane_combat( plane, weap );
self notify( "bots_aim_overlap" );
self BotBuiltinClearAimOverride();
self BotBuiltinClearButtonOverride( "ads" );
}
self.bot_is_doing_some_other_override = false;
} }
self botStopMove( false ); self botStopMove( false );
@ -6376,39 +6388,47 @@ watch_for_melee_override()
{ {
dist = distance( self.origin, threat.origin ); dist = distance( self.origin, threat.origin );
if ( self isonground() && self getstance() != "prone" && !self inLastStand() && dist < getdvarfloat( "aim_automelee_range" ) && ( getConeDot( threat.origin, self.origin, self getplayerangles() ) > 0.9 || dist < 10 ) ) if ( !self.bot_is_doing_some_other_override )
{ {
angles = vectortoangles( threat.origin - self.origin ); self.bot_is_doing_some_other_override = true;
self BotBuiltinBotMeleeParams( angles[ 1 ], dist ); if ( self isonground() && self getstance() != "prone" && !self inLastStand() && dist < getdvarfloat( "aim_automelee_range" ) && ( getConeDot( threat.origin, self.origin, self getplayerangles() ) > 0.9 || dist < 10 ) )
self BotBuiltinButtonOverride( "melee", "enable" );
self BotBuiltinAimOverride();
time_left = 1;
once = false;
while ( time_left > 0 && isdefined( threat ) && isalive( threat ) )
{ {
self setplayerangles( vectortoangles( threat gettagorigin( "j_spine4" ) - self geteye() ) ); angles = vectortoangles( threat.origin - self.origin );
time_left -= 0.05;
wait 0.05; self BotBuiltinBotMeleeParams( angles[ 1 ], dist );
self BotBuiltinButtonOverride( "melee", "enable" );
self BotBuiltinAimOverride();
time_left = 1;
once = false;
while ( time_left > 0 && isdefined( threat ) && isalive( threat ) )
{
self setplayerangles( vectortoangles( threat gettagorigin( "j_spine4" ) - self geteye() ) );
time_left -= 0.05;
wait 0.05;
if ( !once )
{
once = true;
self BotBuiltinClearButtonOverride( "melee" );
}
}
if ( !once ) if ( !once )
{ {
once = true;
self BotBuiltinClearButtonOverride( "melee" ); self BotBuiltinClearButtonOverride( "melee" );
} }
self BotBuiltinClearMeleeParams();
self BotBuiltinClearAimOverride();
wait 1;
break;
} }
if ( !once ) self.bot_is_doing_some_other_override = false;
{
self BotBuiltinClearButtonOverride( "melee" );
}
self BotBuiltinClearMeleeParams();
self BotBuiltinClearAimOverride();
wait 1;
break;
} }
wait 0.05; wait 0.05;
@ -6480,37 +6500,44 @@ watch_for_override_stuff()
weapon_is_good = false; weapon_is_good = false;
} }
if ( weapon_is_good && ( dist > NEAR_DIST ) && ( dist < LONG_DIST ) && ( randomint( 100 ) < chance ) && ( ( time - last_jump_time ) > SPAM_JUMP_TIME ) ) if ( !self.bot_is_doing_some_other_override )
{ {
if ( randomint( 2 ) ) self.bot_is_doing_some_other_override = true;
if ( weapon_is_good && ( dist > NEAR_DIST ) && ( dist < LONG_DIST ) && ( randomint( 100 ) < chance ) && ( ( time - last_jump_time ) > SPAM_JUMP_TIME ) )
{ {
if ( ( getConeDot( threat.origin, self.origin, self getplayerangles() ) > 0.8 ) && ( dist > ( NEAR_DIST * 2 ) ) ) if ( randomint( 2 ) )
{
if ( ( getConeDot( threat.origin, self.origin, self getplayerangles() ) > 0.8 ) && ( dist > ( NEAR_DIST * 2 ) ) )
{
last_jump_time = time;
need_to_clear_mantle_override = true;
self BotBuiltinMantleOverride();
// drop shot
self BotBuiltinMovementOverride( 0, 0 );
self BotBuiltinButtonOverride( "prone", "enable" );
wait 1.5;
self BotBuiltinClearMovementOverride();
self BotBuiltinClearButtonOverride( "prone" );
}
}
else
{ {
last_jump_time = time; last_jump_time = time;
need_to_clear_mantle_override = true; need_to_clear_mantle_override = true;
self BotBuiltinMantleOverride(); self BotBuiltinMantleOverride();
// drop shot // jump shot
self BotBuiltinMovementOverride( 0, 0 ); self BotBuiltinButtonOverride( "gostand", "enable" );
self BotBuiltinButtonOverride( "prone", "enable" ); wait 0.1;
self BotBuiltinClearButtonOverride( "gostand" );
wait 1.5;
self BotBuiltinClearMovementOverride();
self BotBuiltinClearButtonOverride( "prone" );
} }
} }
else
{
last_jump_time = time;
need_to_clear_mantle_override = true;
self BotBuiltinMantleOverride();
// jump shot self.bot_is_doing_some_other_override = false;
self BotBuiltinButtonOverride( "gostand", "enable" );
wait 0.1;
self BotBuiltinClearButtonOverride( "gostand" );
}
} }
thisThreat = self getthreat(); thisThreat = self getthreat();

View File

@ -760,6 +760,7 @@ botStopMove( what )
*/ */
BotSetStance( what ) BotSetStance( what )
{ {
// todo! make these all proper!
} }
/* /*

View File

@ -15,7 +15,7 @@
*/ */
init() init()
{ {
level.bw_version = "1.1.1"; level.bw_version = "1.2.0";
level.bot_offline = false; level.bot_offline = false;