8 Commits

Author SHA1 Message Date
ineed bots
a13fae7a99 added bots_manage_fill_watchplayers 2024-05-15 00:11:21 -06:00
ineed bots
0ee0ddf17d fix errors 2024-05-10 00:07:45 -06:00
ineed bots
fc360e8d22 fixed menu var leak 2024-05-09 20:50:01 -06:00
ineed bots
289f2b3dc5 turret watcher 2024-05-09 14:11:09 -06:00
ineed bots
f683a78336 note 2024-04-30 13:06:40 -06:00
ineed bots
5319878ccc update 2024-04-30 13:06:17 -06:00
ineed bots
72526aa97c fixed ac130/chopper angles,
bots properly use pred missiles
2024-04-30 01:33:00 -06:00
ineed bots
755541e8d2 chat event 2024-04-26 13:38:16 -06:00
8 changed files with 629 additions and 157 deletions

View File

@@ -80,19 +80,20 @@ You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfar
| bots_main_GUIDs | A comma separated list of GUIDs of players who will be given host. | |
| bots_main_waitForHostTime | How many seconds to wait for the host player to connect before adding bots to the match. | 10 |
| bots_main_menu | Enable the in-game menu for hosts. | 1 |
| bots_main_debug | Enable the in-game waypoint editor. | 0 |
| bots_main_debug | Enable the in-game waypoint editor at start of the game, or enable bot event prints. <ul><li>`0` - disable</li><li>`1` - for just debug events</li><li>`2` - for every event</li><ul> | 0 |
| bots_main_kickBotsAtEnd | Kick the bots at the end of a match. | 0 |
| bots_main_chat | The rate bots will chat at, set to 0 to disable. | 1.0 |
| bots_manage_add | Amount of bots to add to the game, once bots are added, resets back to `0`. | 0 |
| bots_manage_fill | Amount of players/bots (look at `bots_manage_fill_mode`) to maintain in the match. | 0 |
| bots_manage_fill_mode | `bots_manage_fill` players/bots counting method.<ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots.</li></ul> | 0 |
| bots_manage_fill_kick | If the amount of players/bots in the match exceeds `bots_manage_fill`, kick bots until no longer exceeds. | 0 |
| bots_manage_fill_mode | `bots_manage_fill` players/bots counting method.<ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots.</li><li>`2` - exactly `0` but auto adjusts `bots_manage_fill` to map.</li><li>`3` - exactly `1` but auto adjusts `bots_manage_fill` to map.</li><li>`4` - bots are used for balancing teams.</ul> | 0 |
| bots_manage_fill_watchplayers | Bots will not be added until one player is in the game | 0 |
| bots_manage_fill_kick | If the amount of players/bots in the match exceeds `bots_manage_fill`, kick bots until no longer exceeds. | 0 |
| bots_manage_fill_spec | If when counting players for `bots_manage_fill` should include spectators. | 1 |
| bots_team | One of `autoassign`, `allies`, `axis`, `spectator`, or `custom`. What team the bots should be on. | autoassign |
| bots_team_amount | When `bots_team` is set to `custom`. The amount of bots to be placed on the axis team. The remainder will be placed on the allies team. | 0 |
| bots_team_force | If the server should force bots' teams according to the `bots_team` value. When `bots_team` is `autoassign`, unbalanced teams will be balanced. This dvar is ignored when `bots_team` is `custom`. | 0 |
| bots_team_mode | When `bots_team_force` is `true` and `bots_team` is `autoassign`, players/bots counting method. <ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots</li></ul> | 0 |
| bots_skill | Bots' difficulty.<ul><li>`0` - Random difficulty for each bot.</li><li>`1` - Easiest difficulty for all bots.</li><li>`2` to `6` - Between easy and hard difficulty for all bots.</li><li>`7` - The hardest difficulty for all bots.</li><li>`8` - custom (look at the `bots_skill_<team>_<difficulty>` dvars)</li></ul> | 0 |
| bots_team_force | If the server should force bots' teams according to the `bots_team` value. When `bots_team` is `autoassign`, unbalanced teams will be balanced. This dvar is ignored when `bots_team` is `custom`. | 0 |
| bots_team_mode | When `bots_team_force` is `1` and `bots_team` is `autoassign`, players/bots counting method. <ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots</li></ul> | 0 |
| bots_skill | Bots' difficulty.<ul><li>`0` - Random difficulty for each bot.</li><li>`1` - Easiest difficulty for all bots.</li><li>`2` to `6` - Between easy and hard difficulty for all bots.</li><li>`7` - The hardest difficulty for all bots.</li><li>`8` - custom (look at the `bots_skill_<team>_<difficulty>` dvars)</li><li>`9` - Every difficulty parameter is randomized</ul> | 0 |
| bots_skill_axis_hard | When `bots_skill` is set to `8`, the amount of hard difficulty bots to set on the axis team. | 0 |
| bots_skill_axis_med | When `bots_skill` is set to `8`, the amount of medium difficulty bots to set on the axis team. The remaining bots on the team will be set to easy difficulty. | 0 |
| bots_skill_allies_hard | When `bots_skill` is set to `8`, the amount of hard difficulty bots to set on the allies team. | 0 |
@@ -117,6 +118,15 @@ You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfar
| bots_play_aim | If the bots can aim. | 1 |
## Changelog
- v2.3.0
- Fixed bots aiming in ac130/chopper being broken at times
- Bots properly use pred missiles
- Smoothed bot aim at range
- Fixed bots_manage_fill_spec players being counted with bots_manage_fill_mode 1 (bot only)
- Added bots_manage_fill_watchplayers dvar
- Bots hop off turrets if they get stuck on one
- Fixed script variable leak with opening and closing the in-game menu
- v2.2.0
- Bots can now melee lunge
- Fixed some chat related script runtime errors
@@ -165,10 +175,8 @@ You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfar
- TODOs
- A variable leak in _menu
- Recoil for bots (engine, maybe script)
- Use static turrets in maps
- Proper use of pred missile
## Credits
- IW4x Team - https://github.com/iw4x/iw4x-client

View File

@@ -15,7 +15,7 @@
*/
init()
{
level.bw_version = "2.2.0";
level.bw_version = "2.3.0";
if ( getdvar( "bots_main" ) == "" )
{
@@ -80,6 +80,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_team" ) == "" )
{
setdvar( "bots_team", "autoassign" ); // which team for bots to join
@@ -277,12 +282,33 @@ init()
level.bots_fullautoguns[ "peacekeeper" ] = true;
level thread fixGamemodes();
level thread fixPredMissile();
level thread onPlayerConnect();
level thread addNotifyOnAirdrops();
level thread watchScrabler();
level thread handleBots();
level thread onPlayerChat();
array_thread( getentarray( "misc_turret", "classname" ), ::turret_monitoruse_watcher );
}
/*
Change func pointer to ours, so that we can link the player ref to the rocket
*/
fixPredMissile()
{
for ( i = 0; i < 19; i++ )
{
if ( isdefined( level.killstreakfuncs ) && isdefined( level.killstreakfuncs[ "predator_missile" ] ) )
{
level.killstreakfuncs[ "predator_missile" ] = ::tryUsePredatorMissileFix;
break;
}
wait 0.05;
}
}
/*
@@ -605,7 +631,7 @@ watchScrabler()
onDisconnectPlayer()
{
name = self.name;
self waittill( "disconnect" );
waittillframeend;
@@ -1081,6 +1107,8 @@ addBots_loop()
players = 0;
bots = 0;
spec = 0;
axisplayers = 0;
alliesplayers = 0;
playercount = level.players.size;
@@ -1099,37 +1127,6 @@ addBots_loop()
else
{
players++;
}
}
if ( !randomint( 999 ) )
{
setdvar( "testclients_doreload", true );
wait 0.1;
setdvar( "testclients_doreload", false );
doExtraCheck();
}
if ( fillMode == 4 )
{
axisplayers = 0;
alliesplayers = 0;
playercount = level.players.size;
for ( i = 0; i < playercount; i++ )
{
player = level.players[ i ];
if ( player is_bot() )
{
continue;
}
if ( !isdefined( player.pers[ "team" ] ) )
{
continue;
}
if ( player.pers[ "team" ] == "axis" )
{
@@ -1140,26 +1137,19 @@ addBots_loop()
alliesplayers++;
}
}
result = fillAmount - abs( axisplayers - alliesplayers ) + bots;
if ( players == 0 )
{
if ( bots < fillAmount )
{
result = fillAmount - 1;
}
else if ( bots > fillAmount )
{
result = fillAmount + 1;
}
else
{
result = fillAmount;
}
}
bots = result;
}
if ( getdvarint( "bots_manage_fill_spec" ) )
{
players += spec;
}
if ( !randomint( 999 ) )
{
setdvar( "testclients_doreload", true );
wait 0.1;
setdvar( "testclients_doreload", false );
doExtraCheck();
}
amount = bots;
@@ -1169,22 +1159,46 @@ addBots_loop()
amount += players;
}
if ( getdvarint( "bots_manage_fill_spec" ) )
// use bots as balance
if ( fillMode == 4 )
{
amount += spec;
diffPlayers = abs( alliesplayers - axisplayers );
amount = fillAmount - ( diffPlayers - bots );
if ( players + diffPlayers < fillAmount )
{
amount = players + bots;
}
}
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" ) )
{
tempBot = getBotToKick();
botsToKick = amount - fillAmount;
if ( isdefined( tempBot ) )
if ( botsToKick > 64 )
{
kick( tempBot getentitynumber(), "EXE_PLAYERKICKED" );
botsToKick = 64;
}
for ( i = 0; i < botsToKick; i++ )
{
tempBot = getBotToKick();
if ( isdefined( tempBot ) )
{
kick( tempBot getentitynumber(), "EXE_PLAYERKICKED" );
wait 0.25;
}
}
}
}
@@ -1329,3 +1343,57 @@ doFiringThread()
wait 1;
self.bots_firing = false;
}
/*
When a player chats
*/
onPlayerChat()
{
for ( ;; )
{
level waittill( "say", message, player, is_hidden );
for ( i = 0; i < level.bots.size; i++ )
{
bot = level.bots[ i ];
bot BotNotifyBotEvent( "chat", "chat", message, player, is_hidden );
}
}
}
/*
Monitors turret usage
*/
turret_monitoruse_watcher()
{
self endon( "death" );
for ( ;; )
{
self waittill ( "trigger", player );
self monitor_player_turret( player );
self.owner = undefined;
if ( isdefined( player ) )
{
player.turret = undefined;
}
}
}
/*
While player uses turret
*/
monitor_player_turret( player )
{
player endon( "death" );
player endon( "disconnect" );
player.turret = self;
self.owner = player;
self waittill( "turret_deactivate" );
}

View File

@@ -316,10 +316,22 @@ start_chat_watch()
case "connection":
self thread bot_chat_connection_player_watch( a, b, c, d, e, f, g );
break;
case "chat":
self thread bot_chat_chat_player_watch( a, b, c, d, e, f, g );
break;
}
}
}
/*
When another player chats
*/
bot_chat_chat_player_watch( chatstr, message, player, is_hidden, e, f, g )
{
self endon( "disconnect" );
}
/*
When a player connected
*/

View File

@@ -234,12 +234,6 @@ onWeaponChange()
{
first = false;
newWeapon = self getcurrentweapon();
// hack fix for botstop overridding weapon
if ( newWeapon != "none" )
{
self switchtoweapon( newWeapon );
}
}
else
{
@@ -375,11 +369,208 @@ watchUsingRemote()
self watchUsingAc130();
}
if ( isdefined( self.rocket ) )
{
self watchUsingPred();
self BotBuiltinBotAction( "-remote" );
}
self.bot.targets = [];
self notify( "kill_goal" );
}
}
/*
Returns the angle delta
*/
getRemoteAngleSpeed( len )
{
furthest = 10.0;
max_speed = 127;
switch ( self.pers[ "bots" ][ "skill" ][ "base" ] )
{
case 1:
furthest = 5.0;
max_speed = 20;
break;
case 2:
furthest = 6.0;
max_speed = 35;
break;
case 3:
furthest = 7.0;
max_speed = 55;
break;
case 4:
furthest = 8.0;
max_speed = 65;
break;
case 5:
furthest = 9.0;
max_speed = 75;
break;
case 6:
furthest = 10.0;
max_speed = 100;
break;
case 7:
furthest = 15.0;
max_speed = 127;
break;
}
if ( len >= furthest )
{
return max_speed;
}
if ( len <= 0.0 )
{
return 0;
}
return Round( ( len / furthest ) * max_speed );
}
/*
time to boost the rocket
*/
getRemoteBoostTime()
{
switch ( self.pers[ "bots" ][ "skill" ][ "base" ] )
{
case 1:
return 99999;
case 2:
return 15000;
case 3:
return 10000;
case 4:
return 5000;
case 5:
return 2500;
case 6:
return 1000;
case 7:
return 500;
default:
return 500;
}
}
/*
While in rocket
*/
watchUsingPred()
{
self.rocket endon( "death" );
self BotBuiltinBotRemoteAngles( 0, 0 );
self BotBuiltinBotAction( "+remote" );
pressedFire = false;
sTime = gettime();
while ( isdefined( self.rocket ) )
{
self.bot.targets = []; // dont want to fire from aim thread
// because geteye doesnt return the eye of the missile
target = undefined;
myeye = self.rocket.origin;
myangles = self.rocket.angles;
bestfov = 0.0;
for ( i = level.players.size - 1; i >= 0; i-- )
{
player = level.players[ i ];
if ( !isdefined( player ) || !isdefined( player.team ) )
{
continue;
}
if ( player == self || ( level.teambased && player.team == self.team ) )
{
continue;
}
if ( player.sessionstate != "playing" || !isreallyalive( player ) )
{
continue;
}
if ( player _hasperk( "specialty_coldblooded" ) )
{
continue;
}
if ( !bullettracepassed( myeye, player.origin + ( 0, 0, 25 ), false, self.rocket ) )
{
continue;
}
thisfov = getConeDot( player.origin, myeye, myangles );
if ( thisfov < 0.75 )
{
continue;
}
if ( isdefined( target ) && thisfov < bestfov )
{
continue;
}
target = player;
bestfov = thisfov;
}
if ( isdefined( target ) )
{
if ( !pressedFire && gettime() - sTime > self getRemoteBoostTime() )
{
pressedFire = true;
self thread pressFire();
}
if ( bestfov < 0.999995 && distancesquared( target.origin, myeye ) > 256 * 256 )
{
angles = vectortoangles( ( target.origin - myeye ) - anglestoforward( myangles ) );
angles -= myangles;
angles = ( angleclamp180( angles[ 0 ] ), angleclamp180( angles[ 1 ] ), 0 );
angles = vectornormalize( angles ) * self getRemoteAngleSpeed( length( angles ) );
self BotBuiltinBotRemoteAngles( int( angles[ 0 ] ), int( angles[ 1 ] ) );
}
else
{
self BotBuiltinBotRemoteAngles( 0, 0 );
}
}
else
{
self BotBuiltinBotRemoteAngles( 0, 0 );
}
wait 0.05;
}
}
/*
WHen it uses the helicopter minigun
*/
@@ -492,6 +683,13 @@ watchPickupGun()
continue;
}
// todo have bots use turrets instead of just kicking them off of it
if ( isdefined( self.turret ) )
{
self thread use( 0.5 );
continue;
}
weap = self getcurrentweapon();
if ( weap != "none" && self getammocount( weap ) )
@@ -1736,7 +1934,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 );
}
@@ -1754,7 +1952,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 );
}
@@ -3127,7 +3325,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;
}
}

View File

@@ -5024,27 +5024,6 @@ getKillstreakTargetLocation()
return location;
}
/*
Clears remote usage when bot dies
*/
clear_remote_on_death( isac130 )
{
self endon( "bot_clear_remote_on_death" );
level endon( "game_ended" );
self waittill_either( "death", "disconnect" );
if ( isdefined( isac130 ) && isac130 )
{
level.ac130inuse = false;
}
if ( isdefined( self ) )
{
self clearusingremote();
}
}
/*
Returns if any harriers exists that is an enemy
*/
@@ -5142,6 +5121,11 @@ bot_killstreak_think_loop( data )
self thread BotPressAttack( 0.05 );
}
if ( iskillstreakweapon( curWeap ) )
{
self thread changeToWeapon( self getlastweapon() );
return;
}
streakName = self.pers[ "killstreaks" ][ 0 ].streakname;
@@ -5246,50 +5230,11 @@ bot_killstreak_think_loop( data )
self BotNotifyBotEvent( "killstreak", "call", streakName, location );
self BotRandomStance();
self setusingremote( "remotemissile" );
self thread clear_remote_on_death();
self BotStopMoving( true );
self changeToWeapon( ksWeap );
if ( !self changeToWeapon( ksWeap ) )
{
self clearusingremote();
self notify( "bot_clear_remote_on_death" );
self BotStopMoving( false );
return;
}
wait 0.05;
self thread changeToWeapon( ksWeap ); // prevent script from changing back
wait 1;
self notify( "bot_clear_remote_on_death" );
wait 3;
self BotStopMoving( false );
if ( self isemped() )
{
self clearusingremote();
self thread changeToWeapon( curWeap );
return;
}
self BotFreezeControls( true );
self maps\mp\killstreaks\_killstreaks::usedkillstreak( "predator_missile", true );
self maps\mp\killstreaks\_killstreaks::shufflekillstreaksfilo( "predator_missile" );
self maps\mp\killstreaks\_killstreaks::giveownedkillstreakitem();
rocket = magicbullet( "remotemissile_projectile_mp", self.origin + ( 0.0, 0.0, 7000.0 - ( self.pers[ "bots" ][ "skill" ][ "base" ] * 400 ) ), location, self );
rocket.lifeid = lifeId;
rocket.type = "remote";
rocket thread maps\mp\gametypes\_weapons::addmissiletosighttraces( self.pers[ "team" ] );
rocket thread maps\mp\killstreaks\_remotemissile::handledamage();
thread maps\mp\killstreaks\_remotemissile::missileeyes( self, rocket );
self waittill( "stopped_using_remote" );
wait 1;
self BotFreezeControls( false );
}
else if ( streakName == "ac130" )
{

View File

@@ -134,6 +134,28 @@ BotBuiltinBotMeleeParams( yaw, dist )
}
}
/*
Sets remote angles
*/
BotBuiltinBotRemoteAngles( pitch, yaw )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "botremoteangles" ] ) )
{
self [[ level.bot_builtins[ "botremoteangles" ] ]]( pitch, yaw );
}
}
/*
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
*/
@@ -3349,3 +3371,167 @@ botPlayerModelForWeapon( weapon, secondary )
break;
}
}
/*
Make player ref attach to rocket ent
*/
tryUsePredatorMissileFix( lifeId )
{
if ( isdefined( level.civilianjetflyby ) )
{
self iprintlnbold( &"MP_CIVILIAN_AIR_TRAFFIC" );
return false;
}
self setusingremote( "remotemissile" );
result = self maps\mp\killstreaks\_killstreaks::initridekillstreak();
if ( result != "success" )
{
if ( result != "disconnect" )
{
self clearusingremote();
}
return false;
}
level thread _fireFix( lifeId, self );
return true;
}
/*
Make player ref attach to rocket ent
*/
_fireFix( lifeId, player )
{
remoteMissileSpawnArray = getentarray( "remoteMissileSpawn", "targetname" );
//assertEX( remoteMissileSpawnArray.size > 0 && getMapCustom( "map" ) != "", "No remote missile spawn points found. Contact friendly neighborhood designer" );
foreach ( spawn in remoteMissileSpawnArray )
{
if ( isdefined( spawn.target ) )
{
spawn.targetent = getent( spawn.target, "targetname" );
}
}
if ( remoteMissileSpawnArray.size > 0 )
{
remoteMissileSpawn = player maps\mp\killstreaks\_remotemissile::getbestspawnpoint( remoteMissileSpawnArray );
}
else
{
remoteMissileSpawn = undefined;
}
if ( isdefined( remoteMissileSpawn ) )
{
startPos = remoteMissileSpawn.origin;
targetPos = remoteMissileSpawn.targetent.origin;
//thread drawLine( startPos, targetPos, 30, (0,1,0) );
vector = vectornormalize( startPos - targetPos );
startPos = vector_multiply( vector, 14000 ) + targetPos;
//thread drawLine( startPos, targetPos, 15, (1,0,0) );
rocket = magicbullet( "remotemissile_projectile_mp", startpos, targetPos, player );
}
else
{
upVector = ( 0, 0, level.missileremotelaunchvert );
backDist = level.missileremotelaunchhorz;
targetDist = level.missileremotelaunchtargetdist;
forward = anglestoforward( player.angles );
startpos = player.origin + upVector + forward * backDist * -1;
targetPos = player.origin + forward * targetDist;
rocket = magicbullet( "remotemissile_projectile_mp", startpos, targetPos, player );
}
if ( !isdefined( rocket ) )
{
player clearusingremote();
return;
}
rocket thread maps\mp\gametypes\_weapons::addmissiletosighttraces( player.team );
rocket thread maps\mp\killstreaks\_remotemissile::handledamage();
rocket.lifeid = lifeId;
rocket.type = "remote";
MissileEyesFix( player, rocket );
}
/*
Make player ref attach to rocket ent
*/
MissileEyesFix( player, rocket )
{
//level endon ( "game_ended" );
player endon( "joined_team" );
player endon( "joined_spectators" );
rocket thread maps\mp\killstreaks\_remotemissile::rocket_cleanupondeath();
player thread maps\mp\killstreaks\_remotemissile::player_cleanupongameended( rocket );
player thread maps\mp\killstreaks\_remotemissile::player_cleanuponteamchange( rocket );
player visionsetmissilecamforplayer( "black_bw", 0 );
player endon ( "disconnect" );
if ( isdefined( rocket ) )
{
player visionsetmissilecamforplayer( game["thermal_vision"], 1.0 );
player thread maps\mp\killstreaks\_remotemissile::delayedfofoverlay();
player cameralinkto( rocket, "tag_origin" );
player controlslinkto( rocket );
// our additions
player.rocket = rocket;
rocket.owner = player;
if ( getdvarint( "camera_thirdPerson" ) )
{
player setthirdpersondof( false );
}
rocket waittill( "death" );
// is defined check required because remote missile doesnt handle lifetime explosion gracefully
// instantly deletes its self after an explode and death notify
if ( isdefined( rocket ) )
{
player maps\mp\_matchdata::logkillstreakevent( "predator_missile", rocket.origin );
}
player controlsunlink();
player freezecontrolswrapper( true );
player.rocket = undefined; // our addition
// If a player gets the final kill with a hellfire, level.gameEnded will already be true at this point
if ( !level.gameended || isdefined( player.finalkill ) )
{
player thread maps\mp\killstreaks\_remotemissile::staticeffect( 0.5 );
}
wait ( 0.5 );
player thermalvisionfofoverlayoff();
player cameraunlink();
if ( getdvarint( "camera_thirdPerson" ) )
{
player setthirdpersondof( true );
}
}
player clearusingremote();
}

View File

@@ -55,6 +55,50 @@ watchPlayers()
}
}
destroyFixed()
{
if ( !isdefined( self ) )
{
return;
}
self destroy();
}
removeChildFixed( element )
{
temp = [];
for ( i = 0; i < self.children.size ; i++ )
{
if ( isdefined( self.children[ i ] ) && self.children[ i ] != element )
{
self.children[ i ].index = temp.size;
temp[ temp.size ] = self.children[ i ];
}
}
self.children = temp;
element.index = undefined;
element.parent = undefined;
}
destroyElemFixed()
{
if ( !isdefined( self ) )
{
return;
}
if ( isdefined( self.parent ) )
{
self.parent removeChildFixed( self );
}
self destroyelem();
}
kill_menu()
{
self notify( "bots_kill_menu" );
@@ -66,7 +110,6 @@ init_menu()
self.menuinit = true;
self.menuopen = false;
self.menu_player = undefined;
self.submenu = "Main";
self.curs[ "Main" ][ "X" ] = 0;
self addOptions();
@@ -95,7 +138,7 @@ watchDisconnect()
{
if ( isdefined( self.menutexty[ i ] ) )
{
self.menutexty[ i ] destroy();
self.menutexty[ i ] destroyElemFixed();
}
}
}
@@ -106,7 +149,7 @@ watchDisconnect()
{
if ( isdefined( self.menutext[ i ] ) )
{
self.menutext[ i ] destroy();
self.menutext[ i ] destroyElemFixed();
}
}
}
@@ -115,18 +158,18 @@ watchDisconnect()
{
if ( isdefined( self.menu[ "X" ][ "Shader" ] ) )
{
self.menu[ "X" ][ "Shader" ] destroy();
self.menu[ "X" ][ "Shader" ] destroyElemFixed();
}
if ( isdefined( self.menu[ "X" ][ "Scroller" ] ) )
{
self.menu[ "X" ][ "Scroller" ] destroy();
self.menu[ "X" ][ "Scroller" ] destroyElemFixed();
}
}
if ( isdefined( self.menuversionhud ) )
{
self.menuversionhud destroy();
self.menuversionhud destroyFixed();
}
}
}
@@ -332,7 +375,7 @@ OpenSub( menu, menu2 )
{
if ( isdefined( self.menutext[ i ] ) )
{
self.menutext[ i ] destroy();
self.menutext[ i ] destroyElemFixed();
}
}
}
@@ -341,18 +384,18 @@ OpenSub( menu, menu2 )
{
if ( isdefined( self.menu[ "X" ][ "Shader" ] ) )
{
self.menu[ "X" ][ "Shader" ] destroy();
self.menu[ "X" ][ "Shader" ] destroyElemFixed();
}
if ( isdefined( self.menu[ "X" ][ "Scroller" ] ) )
{
self.menu[ "X" ][ "Scroller" ] destroy();
self.menu[ "X" ][ "Scroller" ] destroyElemFixed();
}
}
if ( isdefined( self.menuversionhud ) )
{
self.menuversionhud destroy();
self.menuversionhud destroyFixed();
}
for ( i = 0 ; i < self.option[ "Name" ][ self.submenu ].size ; i++ )
@@ -402,7 +445,7 @@ OpenSub( menu, menu2 )
{
if ( isdefined( self.menutexty[ i ] ) )
{
self.menutexty[ i ] destroy();
self.menutexty[ i ] destroyElemFixed();
}
}
}
@@ -426,11 +469,11 @@ CursMove( direction )
if ( self.submenu == "Main" )
{
self.menu[ "X" ][ "Scroller" ].x = self.menutext[ self.curs[ "Main" ][ "X" ] ].x;
self.menu[ "X" ][ "Scroller" ].y = self.menutext[ self.curs[ "Main" ][ "X" ] ].y;
if ( isdefined( self.menutext ) )
{
self.menu[ "X" ][ "Scroller" ].x = self.menutext[ self.curs[ "Main" ][ "X" ] ].x;
self.menu[ "X" ][ "Scroller" ].y = self.menutext[ self.curs[ "Main" ][ "X" ] ].y;
for ( i = 0; i < self.menutext.size; i++ )
{
if ( isdefined( self.menutext[ i ] ) )
@@ -578,7 +621,7 @@ ExitSub()
{
if ( isdefined( self.menutexty[ i ] ) )
{
self.menutexty[ i ] destroy();
self.menutexty[ i ] destroyElemFixed();
}
}
}
@@ -603,7 +646,7 @@ ExitMenu()
{
if ( isdefined( self.menutext[ i ] ) )
{
self.menutext[ i ] destroy();
self.menutext[ i ] destroyElemFixed();
}
}
}
@@ -612,18 +655,18 @@ ExitMenu()
{
if ( isdefined( self.menu[ "X" ][ "Shader" ] ) )
{
self.menu[ "X" ][ "Shader" ] destroy();
self.menu[ "X" ][ "Shader" ] destroyElemFixed();
}
if ( isdefined( self.menu[ "X" ][ "Scroller" ] ) )
{
self.menu[ "X" ][ "Scroller" ] destroy();
self.menu[ "X" ][ "Scroller" ] destroyElemFixed();
}
}
if ( isdefined( self.menuversionhud ) )
{
self.menuversionhud destroy();
self.menuversionhud destroyFixed();
}
self.menuopen = false;

View File

@@ -8,6 +8,8 @@ init()
level.bot_builtins[ "botstop" ] = ::do_botstop;
level.bot_builtins[ "botmovement" ] = ::do_botmovement;
level.bot_builtins[ "botmeleeparams" ] = ::do_botmeleeparams;
level.bot_builtins[ "botremoteangles" ] = ::do_botremoteangles;
level.bot_builtins[ "botangles" ] = ::do_botangles;
}
do_printconsole( s )
@@ -52,3 +54,13 @@ do_botmeleeparams( yaw, dist )
{
self botmeleeparams( yaw, dist );
}
do_botremoteangles( pitch, yaw )
{
self botremoteangles( pitch, yaw );
}
do_botangles( angles )
{
self botangles( angles[ 0 ], angles[ 1 ], angles[ 2 ] );
}