array index spacing

This commit is contained in:
ineed bots 2023-12-22 21:23:10 -06:00
parent d738287275
commit a1d7e85fbc
7 changed files with 1228 additions and 1228 deletions

View File

@ -137,8 +137,8 @@ init()
if ( getDvar( "bots_play_aim" ) == "" )
setDvar( "bots_play_aim", true );
if ( !isDefined( game["botWarfare"] ) )
game["botWarfare"] = true;
if ( !isDefined( game[ "botWarfare" ] ) )
game[ "botWarfare" ] = true;
level.defuseObject = undefined;
level.bots_smokeList = List();
@ -165,36 +165,36 @@ init()
level.bots = [];
level.bots_fullautoguns = [];
level.bots_fullautoguns["fmg9"] = true;
level.bots_fullautoguns["skorpion"] = true;
level.bots_fullautoguns["mp9"] = true;
level.bots_fullautoguns["g18"] = true;
level.bots_fullautoguns["mp5"] = true;
level.bots_fullautoguns["m9"] = true;
level.bots_fullautoguns["p90"] = true;
level.bots_fullautoguns["pp90m1"] = true;
level.bots_fullautoguns["ump45"] = true;
level.bots_fullautoguns["mp7"] = true;
level.bots_fullautoguns["ak47"] = true;
level.bots_fullautoguns["m4"] = true;
level.bots_fullautoguns["fad"] = true;
level.bots_fullautoguns["acr"] = true;
level.bots_fullautoguns["scar"] = true;
level.bots_fullautoguns["g36c"] = true;
level.bots_fullautoguns["cm901"] = true;
level.bots_fullautoguns["aa12"] = true;
level.bots_fullautoguns["m60"] = true;
level.bots_fullautoguns["mk46"] = true;
level.bots_fullautoguns["pecheneg"] = true;
level.bots_fullautoguns["sa80"] = true;
level.bots_fullautoguns["mg36"] = true;
level.bots_fullautoguns[ "fmg9" ] = true;
level.bots_fullautoguns[ "skorpion" ] = true;
level.bots_fullautoguns[ "mp9" ] = true;
level.bots_fullautoguns[ "g18" ] = true;
level.bots_fullautoguns[ "mp5" ] = true;
level.bots_fullautoguns[ "m9" ] = true;
level.bots_fullautoguns[ "p90" ] = true;
level.bots_fullautoguns[ "pp90m1" ] = true;
level.bots_fullautoguns[ "ump45" ] = true;
level.bots_fullautoguns[ "mp7" ] = true;
level.bots_fullautoguns[ "ak47" ] = true;
level.bots_fullautoguns[ "m4" ] = true;
level.bots_fullautoguns[ "fad" ] = true;
level.bots_fullautoguns[ "acr" ] = true;
level.bots_fullautoguns[ "scar" ] = true;
level.bots_fullautoguns[ "g36c" ] = true;
level.bots_fullautoguns[ "cm901" ] = true;
level.bots_fullautoguns[ "aa12" ] = true;
level.bots_fullautoguns[ "m60" ] = true;
level.bots_fullautoguns[ "mk46" ] = true;
level.bots_fullautoguns[ "pecheneg" ] = true;
level.bots_fullautoguns[ "sa80" ] = true;
level.bots_fullautoguns[ "mg36" ] = true;
level.bots_fullautoguns["ak74u"] = true;
level.bots_fullautoguns[ "ak74u" ] = true;
level.bots_fullautoguns["25mm"] = true;
level.bots_fullautoguns["40mm"] = true;
level.bots_fullautoguns["105mm"] = true;
level.bots_fullautoguns["remote"] = true;
level.bots_fullautoguns[ "25mm" ] = true;
level.bots_fullautoguns[ "40mm" ] = true;
level.bots_fullautoguns[ "105mm" ] = true;
level.bots_fullautoguns[ "remote" ] = true;
level thread fixGamemodes();
@ -228,7 +228,7 @@ handleBots()
for ( i = 0; i < bots.size; i++ )
{
kick( bots[i] getEntityNumber() );
kick( bots[ i ] getEntityNumber() );
}
}
@ -243,7 +243,7 @@ onPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon,
self maps\mp\bots\_bot_script::onDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
}
self [[level.prevCallbackPlayerDamage]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
self [[ level.prevCallbackPlayerDamage ]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
}
/*
@ -257,7 +257,7 @@ onPlayerKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sH
self maps\mp\bots\_bot_script::onKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
}
self [[level.prevCallbackPlayerKilled]]( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
self [[ level.prevCallbackPlayerKilled ]]( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
}
/*
@ -284,7 +284,7 @@ fixGamemodes()
if ( isDefined( level.bombZones ) && level.gametype == "sd" )
{
for ( i = 0; i < level.bombZones.size; i++ )
level.bombZones[i].onUse = ::onUsePlantObjectFix;
level.bombZones[ i ].onUse = ::onUsePlantObjectFix;
break;
}
@ -319,10 +319,10 @@ fixDem()
for ( i = 0; i < level.bombZones.size; i++ )
{
if ( isDefined( level.bombZones[i].trigger.trigger_off ) )
level.bombZones[i].bombExploded = true;
if ( isDefined( level.bombZones[ i ].trigger.trigger_off ) )
level.bombZones[ i ].bombExploded = true;
else
level.bombZones[i].bombExploded = undefined;
level.bombZones[ i ].bombExploded = undefined;
}
wait 0.05;
@ -347,10 +347,10 @@ fixKoth()
for ( i = level.radios.size - 1; i >= 0; i-- )
{
if ( level.radioObject != level.radios[i].gameobject )
if ( level.radioObject != level.radios[ i ].gameobject )
continue;
level.radio = level.radios[i];
level.radio = level.radios[ i ];
break;
}
@ -368,7 +368,7 @@ auditModels_loop()
for ( i = s_models.size - 1; i >= 0; i-- )
{
model = s_models[i];
model = s_models[ i ];
if ( !isDefined( model ) )
continue;
@ -379,7 +379,7 @@ auditModels_loop()
if ( model.model == "com_deploy_ballistic_vest_friend_world" )
{
model.bot_audit_model = true;
level.vest_boxes[level.vest_boxes.size] = model;
level.vest_boxes[ level.vest_boxes.size ] = model;
}
}
}
@ -408,13 +408,13 @@ watchRadar_loop()
{
for ( i = level.players.size - 1; i >= 0; i-- )
{
player = level.players[i];
player = level.players[ i ];
player.bot_isInRadar = false;
}
for ( i = level.players.size - 1; i >= 0; i-- )
{
grenade = level.players[i].deployedPortableRadar;
grenade = level.players[ i ].deployedPortableRadar;
if ( !isDefined( grenade ) )
continue;
@ -424,7 +424,7 @@ watchRadar_loop()
for ( h = level.players.size - 1; h >= 0; h-- )
{
player = level.players[h];
player = level.players[ h ];
if ( !isReallyAlive( player ) )
continue;
@ -447,29 +447,29 @@ watchRadar_loop()
for ( i = level.players.size - 1; i >= 0; i-- )
{
if ( !isDefined( level.players[i].personalRadar ) )
if ( !isDefined( level.players[ i ].personalRadar ) )
continue;
if ( !isReallyAlive( level.players[i] ) )
if ( !isReallyAlive( level.players[ i ] ) )
continue;
for ( h = level.players.size - 1; h >= 0; h-- )
{
player = level.players[h];
player = level.players[ h ];
if ( !isReallyAlive( player ) )
continue;
if ( level.players[i] == player )
if ( level.players[ i ] == player )
continue;
if ( level.teamBased && level.players[i].team == player.team )
if ( level.teamBased && level.players[ i ].team == player.team )
continue;
if ( player _hasPerk( "specialty_coldblooded" ) )
continue;
if ( DistanceSquared( player.origin, level.players[i].origin ) > 256 * 256 )
if ( DistanceSquared( player.origin, level.players[ i ].origin ) > 256 * 256 )
continue;
player.bot_isInRadar = true;
@ -480,7 +480,7 @@ watchRadar_loop()
{
for ( h = level.players.size - 1; h >= 0; h-- )
{
player = level.players[h];
player = level.players[ h ];
if ( !isReallyAlive( player ) )
continue;
@ -519,20 +519,20 @@ watchScrabler_loop()
{
for ( i = level.players.size - 1; i >= 0; i-- )
{
player = level.players[i];
player = level.players[ i ];
player.bot_isScrambled = false;
}
for ( i = level.scramblers.size - 1; i >= 0; i-- )
{
scrambler = level.scramblers[i];
scrambler = level.scramblers[ i ];
if ( !isDefined( scrambler ) )
continue;
for ( h = level.players.size - 1; h >= 0; h-- )
{
player = level.players[h];
player = level.players[ h ];
if ( !isReallyAlive( player ) )
continue;
@ -555,19 +555,19 @@ watchScrabler_loop()
drones = [];
if ( isDefined( level.remote_uav["axis"] ) )
drones[drones.size] = level.remote_uav["axis"];
if ( isDefined( level.remote_uav[ "axis" ] ) )
drones[ drones.size ] = level.remote_uav[ "axis" ];
if ( isDefined( level.remote_uav["allies"] ) )
drones[drones.size] = level.remote_uav["allies"];
if ( isDefined( level.remote_uav[ "allies" ] ) )
drones[ drones.size ] = level.remote_uav[ "allies" ];
for ( i = drones.size - 1; i >= 0; i-- )
{
drone = drones[i];
drone = drones[ i ];
for ( h = level.players.size - 1; h >= 0; h-- )
{
player = level.players[h];
player = level.players[ h ];
if ( !isReallyAlive( player ) )
continue;
@ -611,7 +611,7 @@ addNotifyOnAirdrops_loop()
for ( i = dropCrates.size - 1; i >= 0; i-- )
{
airdrop = dropCrates[i];
airdrop = dropCrates[ i ];
if ( isDefined( airdrop.doingPhysics ) )
continue;
@ -700,28 +700,28 @@ connected()
{
self endon( "disconnect" );
if ( !isDefined( self.pers["bot_host"] ) )
if ( !isDefined( self.pers[ "bot_host" ] ) )
self thread doHostCheck();
if ( !self is_bot() )
return;
if ( !isDefined( self.pers["isBot"] ) )
if ( !isDefined( self.pers[ "isBot" ] ) )
{
// fast_restart occured...
self.pers["isBot"] = true;
self.pers[ "isBot" ] = true;
}
if ( !isDefined( self.pers["isBotWarfare"] ) )
if ( !isDefined( self.pers[ "isBotWarfare" ] ) )
{
self.pers["isBotWarfare"] = true;
self.pers[ "isBotWarfare" ] = true;
self thread added();
}
self thread maps\mp\bots\_bot_internal::connected();
self thread maps\mp\bots\_bot_script::connected();
level.bots[level.bots.size] = self;
level.bots[ level.bots.size ] = self;
self thread onDisconnect();
level notify( "bot_connected", self );
@ -794,8 +794,8 @@ add_bot()
if ( isdefined( bot ) )
{
bot.pers["isBot"] = true;
bot.pers["isBotWarfare"] = true;
bot.pers[ "isBot" ] = true;
bot.pers[ "isBotWarfare" ] = true;
bot thread added();
}
}
@ -822,43 +822,43 @@ diffBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( !isDefined( player.pers["team"] ) )
if ( !isDefined( player.pers[ "team" ] ) )
continue;
if ( !player is_bot() )
continue;
if ( player.pers["team"] == "axis" )
if ( player.pers[ "team" ] == "axis" )
{
if ( axis_hard < var_axis_hard )
{
axis_hard++;
player.pers["bots"]["skill"]["base"] = 7;
player.pers[ "bots" ][ "skill" ][ "base" ] = 7;
}
else if ( axis_med < var_axis_med )
{
axis_med++;
player.pers["bots"]["skill"]["base"] = 4;
player.pers[ "bots" ][ "skill" ][ "base" ] = 4;
}
else
player.pers["bots"]["skill"]["base"] = 1;
player.pers[ "bots" ][ "skill" ][ "base" ] = 1;
}
else if ( player.pers["team"] == "allies" )
else if ( player.pers[ "team" ] == "allies" )
{
if ( allies_hard < var_allies_hard )
{
allies_hard++;
player.pers["bots"]["skill"]["base"] = 7;
player.pers[ "bots" ][ "skill" ][ "base" ] = 7;
}
else if ( allies_med < var_allies_med )
{
allies_med++;
player.pers["bots"]["skill"]["base"] = 4;
player.pers[ "bots" ][ "skill" ][ "base" ] = 4;
}
else
player.pers["bots"]["skill"]["base"] = 1;
player.pers[ "bots" ][ "skill" ][ "base" ] = 1;
}
}
}
@ -868,12 +868,12 @@ diffBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( !player is_bot() )
continue;
player.pers["bots"]["skill"]["base"] = var_skill;
player.pers[ "bots" ][ "skill" ][ "base" ] = var_skill;
}
}
@ -883,12 +883,12 @@ diffBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( !player is_bot() )
continue;
player.pers["bots"]["skill"]["base"] = int( clamp( player.pers["bots"]["skill"]["base"], min_diff, max_diff ) );
player.pers[ "bots" ][ "skill" ][ "base" ] = int( clamp( player.pers[ "bots" ][ "skill" ][ "base" ], min_diff, max_diff ) );
}
}
@ -922,23 +922,23 @@ teamBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( !isDefined( player.pers["team"] ) )
if ( !isDefined( player.pers[ "team" ] ) )
continue;
if ( player is_bot() )
{
if ( player.pers["team"] == "allies" )
if ( player.pers[ "team" ] == "allies" )
alliesbots++;
else if ( player.pers["team"] == "axis" )
else if ( player.pers[ "team" ] == "axis" )
axisbots++;
}
else
{
if ( player.pers["team"] == "allies" )
if ( player.pers[ "team" ] == "allies" )
alliesplayers++;
else if ( player.pers["team"] == "axis" )
else if ( player.pers[ "team" ] == "axis" )
axisplayers++;
}
}
@ -973,23 +973,23 @@ teamBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( !isDefined( player.pers["team"] ) )
if ( !isDefined( player.pers[ "team" ] ) )
continue;
if ( !player is_bot() )
continue;
if ( player.pers["team"] == toTeam )
if ( player.pers[ "team" ] == toTeam )
continue;
if ( toTeam == "allies" )
player thread [[level.allies]]();
player thread [[ level.allies ]]();
else if ( toTeam == "axis" )
player thread [[level.axis]]();
player thread [[ level.axis ]]();
else
player thread [[level.spectator]]();
player thread [[ level.spectator ]]();
break;
}
@ -1002,19 +1002,19 @@ teamBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( !isDefined( player.pers["team"] ) )
if ( !isDefined( player.pers[ "team" ] ) )
continue;
if ( !player is_bot() )
continue;
if ( player.pers["team"] == "axis" )
if ( player.pers[ "team" ] == "axis" )
{
if ( axis > teamAmount )
{
player thread [[level.allies]]();
player thread [[ level.allies ]]();
break;
}
}
@ -1022,12 +1022,12 @@ teamBots_loop()
{
if ( axis < teamAmount )
{
player thread [[level.axis]]();
player thread [[ level.axis ]]();
break;
}
else if ( player.pers["team"] != "allies" )
else if ( player.pers[ "team" ] != "allies" )
{
player thread [[level.allies]]();
player thread [[ level.allies ]]();
break;
}
}
@ -1083,11 +1083,11 @@ addBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( player is_bot() )
bots++;
else if ( !isDefined( player.pers["team"] ) || ( player.pers["team"] != "axis" && player.pers["team"] != "allies" ) )
else if ( !isDefined( player.pers[ "team" ] ) || ( player.pers[ "team" ] != "axis" && player.pers[ "team" ] != "allies" ) )
spec++;
else
players++;
@ -1110,17 +1110,17 @@ addBots_loop()
for ( i = 0; i < playercount; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( player is_bot() )
continue;
if ( !isDefined( player.pers["team"] ) )
if ( !isDefined( player.pers[ "team" ] ) )
continue;
if ( player.pers["team"] == "axis" )
if ( player.pers[ "team" ] == "axis" )
axisplayers++;
else if ( player.pers["team"] == "allies" )
else if ( player.pers[ "team" ] == "allies" )
alliesplayers++;
}

View File

@ -150,15 +150,15 @@ start_killed_watch()
{
self waittill( "killed_enemy" );
if ( self.bots_lastKS < self.pers["cur_kill_streak"] )
if ( self.bots_lastKS < self.pers[ "cur_kill_streak" ] )
{
for ( i = self.bots_lastKS + 1; i <= self.pers["cur_kill_streak"]; i++ )
for ( i = self.bots_lastKS + 1; i <= self.pers[ "cur_kill_streak" ]; i++ )
{
self thread bot_chat_streak( i );
}
}
self.bots_lastKS = self.pers["cur_kill_streak"];
self.bots_lastKS = self.pers[ "cur_kill_streak" ];
self thread bot_chat_killed_watch( self.lastKilledPlayer );
}
@ -546,18 +546,18 @@ endgame_chat()
for ( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( player.pers["score"] > b )
if ( player.pers[ "score" ] > b )
{
winner = player;
b = player.pers["score"];
b = player.pers[ "score" ];
}
if ( player.pers["score"] < w )
if ( player.pers[ "score" ] < w )
{
loser = player;
w = player.pers["score"];
w = player.pers[ "score" ];
}
}
@ -565,7 +565,7 @@ endgame_chat()
{
winningteam = maps\mp\gametypes\_gamescore::getWinningTeam();
if ( self.pers["team"] == winningteam )
if ( self.pers[ "team" ] == winningteam )
{
switch ( randomint( 21 ) )
{
@ -598,7 +598,7 @@ endgame_chat()
break;
case 7:
self BotDoChat( 20, "^" + ( randomint( 6 ) + 1 ) + "My team " + self.pers["team"] + " always wins!!" );
self BotDoChat( 20, "^" + ( randomint( 6 ) + 1 ) + "My team " + self.pers[ "team" ] + " always wins!!" );
break;
case 8:
@ -693,7 +693,7 @@ endgame_chat()
break;
case 5:
self BotDoChat( 20, "^" + ( randomint( 6 ) + 1 ) + "My team " + self.pers["team"] + " always loses!!" );
self BotDoChat( 20, "^" + ( randomint( 6 ) + 1 ) + "My team " + self.pers[ "team" ] + " always loses!!" );
break;
case 2:
@ -975,7 +975,7 @@ bot_chat_streak( streakCount )
if ( streakCount == 25 )
{
if ( self.pers["lastEarnedStreak"] == "nuke" )
if ( self.pers[ "lastEarnedStreak" ] == "nuke" )
{
switch ( randomint( 5 ) )
{
@ -1138,11 +1138,11 @@ bot_chat_killed_watch( victim )
break;
case 30:
message = ( "haha thanks " + victim.name + ", im at a " + self.pers["cur_kill_streak"] + " streak." );
message = ( "haha thanks " + victim.name + ", im at a " + self.pers[ "cur_kill_streak" ] + " streak." );
break;
case 31:
message = ( "lol " + victim.name + " is at a " + victim.pers["cur_death_streak"] + " deathstreak" );
message = ( "lol " + victim.name + " is at a " + victim.pers[ "cur_death_streak" ] + " deathstreak" );
break;
case 32:
@ -1178,8 +1178,8 @@ bot_chat_killed_watch( victim )
break;
case 40:
if ( isDefined( victim.attackerData ) && isDefined( victim.attackerData[self.guid] ) && isDefined( victim.attackerData[self.guid].weapon ) )
message = ( "Man, I sure love my " + getBaseWeaponName( victim.attackerData[self.guid].weapon ) + "!" );
if ( isDefined( victim.attackerData ) && isDefined( victim.attackerData[ self.guid ] ) && isDefined( victim.attackerData[ self.guid ].weapon ) )
message = ( "Man, I sure love my " + getBaseWeaponName( victim.attackerData[ self.guid ].weapon ) + "!" );
break;
@ -1226,7 +1226,7 @@ bot_chat_death_watch( killer, last_ks )
if ( last_ks > 0 )
message = ( "^" + ( randomint( 6 ) + 1 ) + "Nooooooooo my killstreaks!! :( I had a " + last_ks + " killstreak!!" );
else
message = ( "man im getting spawn killed, i have a " + self.pers["cur_death_streak"] + " deathstreak!" );
message = ( "man im getting spawn killed, i have a " + self.pers[ "cur_death_streak" ] + " deathstreak!" );
break;
@ -1323,19 +1323,19 @@ bot_chat_death_watch( killer, last_ks )
break;
case 28:
message = ( "AHH! IM DEAD BECAUSE " + level.players[randomint( level.players.size )].name + " is a noob!" );
message = ( "AHH! IM DEAD BECAUSE " + level.players[ randomint( level.players.size ) ].name + " is a noob!" );
break;
case 29:
message = ( level.players[randomint( level.players.size )].name + ", please don't talk." );
message = ( level.players[ randomint( level.players.size ) ].name + ", please don't talk." );
break;
case 30:
message = ( "Wow " + level.players[randomint( level.players.size )].name + " is a blocker noob!" );
message = ( "Wow " + level.players[ randomint( level.players.size ) ].name + " is a blocker noob!" );
break;
case 31:
message = ( "Next time GET OUT OF MY WAY " + level.players[randomint( level.players.size )].name + "!!" );
message = ( "Next time GET OUT OF MY WAY " + level.players[ randomint( level.players.size ) ].name + "!!" );
break;
case 32:
@ -1391,7 +1391,7 @@ bot_chat_death_watch( killer, last_ks )
break;
case 45:
message = ( "someone kill " + killer.name + ", they are on a streak of " + killer.pers["cur_kill_streak"] + "!" );
message = ( "someone kill " + killer.name + ", they are on a streak of " + killer.pers[ "cur_kill_streak" ] + "!" );
break;
case 46:
@ -1451,8 +1451,8 @@ bot_chat_death_watch( killer, last_ks )
break;
case 60:
if ( isDefined( self.attackerData ) && isDefined( self.attackerData[killer.guid] ) && isDefined( self.attackerData[killer.guid].weapon ) )
message = "Wow! Nice " + getBaseWeaponName( self.attackerData[killer.guid].weapon ) + " you got there, " + killer.name + "!";
if ( isDefined( self.attackerData ) && isDefined( self.attackerData[ killer.guid ] ) && isDefined( self.attackerData[ killer.guid ].weapon ) )
message = "Wow! Nice " + getBaseWeaponName( self.attackerData[ killer.guid ].weapon ) + " you got there, " + killer.name + "!";
break;

View File

@ -19,45 +19,45 @@ added()
{
self endon( "disconnect" );
self.pers["bots"] = [];
self.pers[ "bots" ] = [];
self.pers["bots"]["skill"] = [];
self.pers["bots"]["skill"]["base"] = 7; // a base knownledge of the bot
self.pers["bots"]["skill"]["aim_time"] = 0.05; // how long it takes for a bot to aim to a location
self.pers["bots"]["skill"]["init_react_time"] = 0; // the reaction time of the bot for inital targets
self.pers["bots"]["skill"]["reaction_time"] = 0; // reaction time for the bots of reoccuring targets
self.pers["bots"]["skill"]["no_trace_ads_time"] = 2500; // how long a bot ads's when they cant see the target
self.pers["bots"]["skill"]["no_trace_look_time"] = 10000; // how long a bot will look at a target's last position
self.pers["bots"]["skill"]["remember_time"] = 25000; // how long a bot will remember a target before forgetting about it when they cant see the target
self.pers["bots"]["skill"]["fov"] = -1; // the fov of the bot, -1 being 360, 1 being 0
self.pers["bots"]["skill"]["dist_max"] = 100000 * 2; // the longest distance a bot will target
self.pers["bots"]["skill"]["dist_start"] = 100000; // the start distance before bot's target abilitys diminish
self.pers["bots"]["skill"]["spawn_time"] = 0; // how long a bot waits after spawning before targeting, etc
self.pers["bots"]["skill"]["help_dist"] = 10000; // how far a bot has awareness
self.pers["bots"]["skill"]["semi_time"] = 0.05; // how fast a bot shoots semiauto
self.pers["bots"]["skill"]["shoot_after_time"] = 1; // how long a bot shoots after target dies/cant be seen
self.pers["bots"]["skill"]["aim_offset_time"] = 1; // how long a bot correct's their aim after targeting
self.pers["bots"]["skill"]["aim_offset_amount"] = 1; // how far a bot's incorrect aim is
self.pers["bots"]["skill"]["bone_update_interval"] = 0.05; // how often a bot changes their bone target
self.pers["bots"]["skill"]["bones"] = "j_head"; // a list of comma seperated bones the bot will aim at
self.pers["bots"]["skill"]["ads_fov_multi"] = 0.5; // a factor of how much ads to reduce when adsing
self.pers["bots"]["skill"]["ads_aimspeed_multi"] = 0.5; // a factor of how much more aimspeed delay to add
self.pers[ "bots" ][ "skill" ] = [];
self.pers[ "bots" ][ "skill" ][ "base" ] = 7; // a base knownledge of the bot
self.pers[ "bots" ][ "skill" ][ "aim_time" ] = 0.05; // how long it takes for a bot to aim to a location
self.pers[ "bots" ][ "skill" ][ "init_react_time" ] = 0; // the reaction time of the bot for inital targets
self.pers[ "bots" ][ "skill" ][ "reaction_time" ] = 0; // reaction time for the bots of reoccuring targets
self.pers[ "bots" ][ "skill" ][ "no_trace_ads_time" ] = 2500; // how long a bot ads's when they cant see the target
self.pers[ "bots" ][ "skill" ][ "no_trace_look_time" ] = 10000; // how long a bot will look at a target's last position
self.pers[ "bots" ][ "skill" ][ "remember_time" ] = 25000; // how long a bot will remember a target before forgetting about it when they cant see the target
self.pers[ "bots" ][ "skill" ][ "fov" ] = -1; // the fov of the bot, -1 being 360, 1 being 0
self.pers[ "bots" ][ "skill" ][ "dist_max" ] = 100000 * 2; // the longest distance a bot will target
self.pers[ "bots" ][ "skill" ][ "dist_start" ] = 100000; // the start distance before bot's target abilitys diminish
self.pers[ "bots" ][ "skill" ][ "spawn_time" ] = 0; // how long a bot waits after spawning before targeting, etc
self.pers[ "bots" ][ "skill" ][ "help_dist" ] = 10000; // how far a bot has awareness
self.pers[ "bots" ][ "skill" ][ "semi_time" ] = 0.05; // how fast a bot shoots semiauto
self.pers[ "bots" ][ "skill" ][ "shoot_after_time" ] = 1; // how long a bot shoots after target dies/cant be seen
self.pers[ "bots" ][ "skill" ][ "aim_offset_time" ] = 1; // how long a bot correct's their aim after targeting
self.pers[ "bots" ][ "skill" ][ "aim_offset_amount" ] = 1; // how far a bot's incorrect aim is
self.pers[ "bots" ][ "skill" ][ "bone_update_interval" ] = 0.05; // how often a bot changes their bone target
self.pers[ "bots" ][ "skill" ][ "bones" ] = "j_head"; // a list of comma seperated bones the bot will aim at
self.pers[ "bots" ][ "skill" ][ "ads_fov_multi" ] = 0.5; // a factor of how much ads to reduce when adsing
self.pers[ "bots" ][ "skill" ][ "ads_aimspeed_multi" ] = 0.5; // a factor of how much more aimspeed delay to add
self.pers["bots"]["behavior"] = [];
self.pers["bots"]["behavior"]["strafe"] = 50; // percentage of how often the bot strafes a target
self.pers["bots"]["behavior"]["nade"] = 50; // percentage of how often the bot will grenade
self.pers["bots"]["behavior"]["sprint"] = 50; // percentage of how often the bot will sprint
self.pers["bots"]["behavior"]["camp"] = 50; // percentage of how often the bot will camp
self.pers["bots"]["behavior"]["follow"] = 50; // percentage of how often the bot will follow
self.pers["bots"]["behavior"]["crouch"] = 10; // percentage of how often the bot will crouch
self.pers["bots"]["behavior"]["switch"] = 1; // percentage of how often the bot will switch weapons
self.pers["bots"]["behavior"]["class"] = 1; // percentage of how often the bot will change classes
self.pers["bots"]["behavior"]["jump"] = 100; // percentage of how often the bot will jumpshot and dropshot
self.pers[ "bots" ][ "behavior" ] = [];
self.pers[ "bots" ][ "behavior" ][ "strafe" ] = 50; // percentage of how often the bot strafes a target
self.pers[ "bots" ][ "behavior" ][ "nade" ] = 50; // percentage of how often the bot will grenade
self.pers[ "bots" ][ "behavior" ][ "sprint" ] = 50; // percentage of how often the bot will sprint
self.pers[ "bots" ][ "behavior" ][ "camp" ] = 50; // percentage of how often the bot will camp
self.pers[ "bots" ][ "behavior" ][ "follow" ] = 50; // percentage of how often the bot will follow
self.pers[ "bots" ][ "behavior" ][ "crouch" ] = 10; // percentage of how often the bot will crouch
self.pers[ "bots" ][ "behavior" ][ "switch" ] = 1; // percentage of how often the bot will switch weapons
self.pers[ "bots" ][ "behavior" ][ "class" ] = 1; // percentage of how often the bot will change classes
self.pers[ "bots" ][ "behavior" ][ "jump" ] = 100; // percentage of how often the bot will jumpshot and dropshot
self.pers["bots"]["behavior"]["quickscope"] = false; // is a quickscoper
self.pers["bots"]["behavior"]["initswitch"] = 10; // percentage of how often the bot will switch weapons on spawn
self.pers[ "bots" ][ "behavior" ][ "quickscope" ] = false; // is a quickscoper
self.pers[ "bots" ][ "behavior" ][ "initswitch" ] = 10; // percentage of how often the bot will switch weapons on spawn
self.pers["bots"]["unlocks"] = [];
self.pers[ "bots" ][ "unlocks" ] = [];
}
/*
@ -365,10 +365,10 @@ watchUsingRemote()
*/
watchUsingTurret()
{
if ( !isDefined( self.remoteTurretList ) || !isDefined( self.remoteTurretList[0] ) )
if ( !isDefined( self.remoteTurretList ) || !isDefined( self.remoteTurretList[ 0 ] ) )
return;
turret = self.remoteTurretList[0];
turret = self.remoteTurretList[ 0 ];
turret endon( "death" );
@ -396,7 +396,7 @@ watchUsingTank()
for ( i = tankKeys.size - 1; i >= 0; i-- )
{
tempTank = level.ugvs[tankKeys[i]];
tempTank = level.ugvs[ tankKeys[ i ] ];
if ( !isDefined( tempTank ) )
continue;
@ -566,7 +566,7 @@ spawned()
self endon( "disconnect" );
self endon( "death" );
wait self.pers["bots"]["skill"]["spawn_time"];
wait self.pers[ "bots" ][ "skill" ][ "spawn_time" ];
self thread doBotMovement();
@ -647,7 +647,7 @@ watchC4Thrown( c4 )
for ( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( player == self )
continue;
@ -695,22 +695,22 @@ doBotMovement_loop( data )
if ( DistanceSquared( self.bot.moveOrigin, move_To ) >= 49 )
{
cosa = cos( 0 - angles[1] );
sina = sin( 0 - angles[1] );
cosa = cos( 0 - angles[ 1 ] );
sina = sin( 0 - angles[ 1 ] );
// get the direction
dir = move_To - self.bot.moveOrigin;
// rotate our direction according to our angles
dir = ( dir[0] * cosa - dir[1] * sina,
dir[0] * sina + dir[1] * cosa,
dir = ( dir[ 0 ] * cosa - dir[ 1 ] * sina,
dir[ 0 ] * sina + dir[ 1 ] * cosa,
0 );
// make the length 127
dir = VectorNormalize( dir ) * 127;
// invert the second component as the engine requires this
dir = ( dir[0], 0 - dir[1], 0 );
dir = ( dir[ 0 ], 0 - dir[ 1 ], 0 );
}
// climb through windows
@ -726,22 +726,22 @@ doBotMovement_loop( data )
}
startPos = self.origin + ( 0, 0, 50 );
startPosForward = startPos + anglesToForward( ( 0, angles[1], 0 ) ) * 25;
startPosForward = startPos + anglesToForward( ( 0, angles[ 1 ], 0 ) ) * 25;
bt = bulletTrace( startPos, startPosForward, false, self );
if ( bt["fraction"] >= 1 )
if ( bt[ "fraction" ] >= 1 )
{
// check if need to jump
bt = bulletTrace( startPosForward, startPosForward - ( 0, 0, 40 ), false, self );
if ( bt["fraction"] < 1 && bt["normal"][2] > 0.9 && data.i > 1.5 && !self isOnLadder() )
if ( bt[ "fraction" ] < 1 && bt[ "normal" ][ 2 ] > 0.9 && data.i > 1.5 && !self isOnLadder() )
{
data.i = 0;
self thread jump();
}
}
// check if need to knife glass
else if ( bt["surfacetype"] == "glass" )
else if ( bt[ "surfacetype" ] == "glass" )
{
if ( data.i > 1.5 )
{
@ -758,15 +758,15 @@ doBotMovement_loop( data )
// move!
if ( ( self.bot.wantsprint && self.bot.issprinting ) || isDefined( self.bot.knifing_target ) )
dir = ( 127, dir[1], 0 );
dir = ( 127, dir[ 1 ], 0 );
self BotBuiltinBotMovement( int( dir[0] ), int( dir[1] ) );
self BotBuiltinBotMovement( int( dir[ 0 ] ), int( dir[ 1 ] ) );
if ( isDefined( self.remoteUAV ) )
{
if ( abs( move_To[2] - self.bot.moveOrigin[2] ) > 12 )
if ( abs( move_To[ 2 ] - self.bot.moveOrigin[ 2 ] ) > 12 )
{
if ( move_To[2] > self.bot.moveOrigin[2] )
if ( move_To[ 2 ] > self.bot.moveOrigin[ 2 ] )
self thread gostand();
else
self thread sprint();
@ -824,7 +824,7 @@ grenade_danager_loop()
for ( i = level.bots_fragList.count - 1; i >= 0; i-- )
{
frag = level.bots_fragList.data[i];
frag = level.bots_fragList.data[ i ];
if ( level.teamBased && frag.team == self.team )
continue;
@ -883,12 +883,12 @@ stance_loop()
toStance = "stand";
if ( self.bot.next_wp != -1 )
toStance = level.waypoints[self.bot.next_wp].type;
toStance = level.waypoints[ self.bot.next_wp ].type;
if ( !isDefined( toStance ) )
toStance = "crouch";
if ( toStance == "stand" && randomInt( 100 ) <= self.pers["bots"]["behavior"]["crouch"] )
if ( toStance == "stand" && randomInt( 100 ) <= self.pers[ "bots" ][ "behavior" ][ "crouch" ] )
toStance = "crouch";
if ( self.hasRiotShieldEquipped && isDefined( self.bot.target ) && isDefined( self.bot.target.entity ) && isPlayer( self.bot.target.entity ) )
@ -912,7 +912,7 @@ stance_loop()
curweap = self getCurrentWeapon();
time = getTime();
chance = self.pers["bots"]["behavior"]["sprint"];
chance = self.pers[ "bots" ][ "behavior" ][ "sprint" ];
if ( time - self.lastSpawnTime < 5000 )
chance *= 2;
@ -1033,8 +1033,8 @@ updateBones()
self endon( "disconnect" );
self endon( "spawned_player" );
bones = strtok( self.pers["bots"]["skill"]["bones"], "," );
waittime = self.pers["bots"]["skill"]["bone_update_interval"];
bones = strtok( self.pers[ "bots" ][ "skill" ][ "bones" ], "," );
waittime = self.pers[ "bots" ][ "skill" ][ "bone_update_interval" ];
for ( ;; )
{
@ -1080,7 +1080,7 @@ updateAimOffset( obj, theTime )
{
if ( !isDefined( obj.aim_offset_base ) )
{
offsetAmount = self.pers["bots"]["skill"]["aim_offset_amount"];
offsetAmount = self.pers[ "bots" ][ "skill" ][ "aim_offset_amount" ];
if ( offsetAmount > 0 )
obj.aim_offset_base = ( randomFloatRange( 0 - offsetAmount, offsetAmount ),
@ -1090,7 +1090,7 @@ updateAimOffset( obj, theTime )
obj.aim_offset_base = ( 0, 0, 0 );
}
aimDiffTime = self.pers["bots"]["skill"]["aim_offset_time"] * 1000;
aimDiffTime = self.pers[ "bots" ][ "skill" ][ "aim_offset_time" ] * 1000;
objCreatedFor = obj.trace_time;
if ( objCreatedFor >= aimDiffTime )
@ -1106,11 +1106,11 @@ updateAimOffset( obj, theTime )
*/
targetObjUpdateTraced( obj, daDist, ent, theTime, isScriptObj, usingRemote )
{
distClose = self.pers["bots"]["skill"]["dist_start"];
distClose = self.pers[ "bots" ][ "skill" ][ "dist_start" ];
distClose *= self.bot.cur_weap_dist_multi;
distClose *= distClose;
distMax = self.pers["bots"]["skill"]["dist_max"];
distMax = self.pers[ "bots" ][ "skill" ][ "dist_max" ];
distMax *= self.bot.cur_weap_dist_multi;
distMax *= distMax;
@ -1155,17 +1155,17 @@ target_loop()
theTime = getTime();
myAngles = self GetPlayerAngles();
myFov = self.pers["bots"]["skill"]["fov"];
myFov = self.pers[ "bots" ][ "skill" ][ "fov" ];
bestTargets = [];
bestTime = 2147483647;
rememberTime = self.pers["bots"]["skill"]["remember_time"];
initReactTime = self.pers["bots"]["skill"]["init_react_time"];
rememberTime = self.pers[ "bots" ][ "skill" ][ "remember_time" ];
initReactTime = self.pers[ "bots" ][ "skill" ][ "init_react_time" ];
hasTarget = isDefined( self.bot.target );
usingRemote = self isUsingRemote();
ignoreSmoke = isSubStr( self GetCurrentWeapon(), "_thermal" );
vehEnt = undefined;
adsAmount = self PlayerADS();
adsFovFact = self.pers["bots"]["skill"]["ads_fov_multi"];
adsFovFact = self.pers[ "bots" ][ "skill" ][ "ads_fov_multi" ];
if ( usingRemote )
{
@ -1202,7 +1202,7 @@ target_loop()
ent = self.bot.script_target;
key = ent getEntityNumber() + "";
daDist = distanceSquared( self.origin, ent.origin );
obj = self.bot.targets[key];
obj = self.bot.targets[ key ];
isObjDef = isDefined( obj );
entOrigin = ent.origin;
@ -1216,7 +1216,7 @@ target_loop()
obj = self createTargetObj( ent, theTime );
obj.offset = self.bot.script_target_offset;
self.bot.targets[key] = obj;
self.bot.targets[ key ] = obj;
}
self targetObjUpdateTraced( obj, daDist, ent, theTime, true, usingRemote );
@ -1230,20 +1230,20 @@ target_loop()
if ( obj.no_trace_time > rememberTime )
{
self.bot.targets[key] = undefined;
self.bot.targets[ key ] = undefined;
continue;
}
}
}
else
{
player = level.players[i];
player = level.players[ i ];
if ( player == self )
continue;
key = player getEntityNumber() + "";
obj = self.bot.targets[key];
obj = self.bot.targets[ key ];
daDist = distanceSquared( self.origin, player.origin );
@ -1255,7 +1255,7 @@ target_loop()
if ( ( level.teamBased && self.team == player.team ) || player.sessionstate != "playing" || !isReallyAlive( player ) )
{
if ( isObjDef )
self.bot.targets[key] = undefined;
self.bot.targets[ key ] = undefined;
continue;
}
@ -1281,9 +1281,9 @@ target_loop()
sightTracePassed( myEye, targetAnkleLeft, false, undefined ) ||
sightTracePassed( myEye, targetAnkleRight, false, undefined ) )
&& ( ( traceHead["fraction"] >= 1.0 || traceHead["surfacetype"] == "glass" ) ||
( traceAnkleLeft["fraction"] >= 1.0 || traceAnkleLeft["surfacetype"] == "glass" ) ||
( traceAnkleRight["fraction"] >= 1.0 || traceAnkleRight["surfacetype"] == "glass" ) )
&& ( ( traceHead[ "fraction" ] >= 1.0 || traceHead[ "surfacetype" ] == "glass" ) ||
( traceAnkleLeft[ "fraction" ] >= 1.0 || traceAnkleLeft[ "surfacetype" ] == "glass" ) ||
( traceAnkleRight[ "fraction" ] >= 1.0 || traceAnkleRight[ "surfacetype" ] == "glass" ) )
&& ( ignoreSmoke ||
SmokeTrace( myEye, player.origin, level.smokeRadius ) ||
@ -1309,7 +1309,7 @@ target_loop()
{
obj = self createTargetObj( player, theTime );
self.bot.targets[key] = obj;
self.bot.targets[ key ] = obj;
}
self targetObjUpdateTraced( obj, daDist, player, theTime, false, usingRemote );
@ -1323,7 +1323,7 @@ target_loop()
if ( obj.no_trace_time > rememberTime )
{
self.bot.targets[key] = undefined;
self.bot.targets[ key ] = undefined;
continue;
}
}
@ -1344,10 +1344,10 @@ target_loop()
}
if ( timeDiff == bestTime )
bestTargets[key] = obj;
bestTargets[ key ] = obj;
}
if ( hasTarget && isDefined( bestTargets[self.bot.target.entity getEntityNumber() + ""] ) )
if ( hasTarget && isDefined( bestTargets[ self.bot.target.entity getEntityNumber() + "" ] ) )
return;
closest = 2147483647;
@ -1357,13 +1357,13 @@ target_loop()
for ( i = bestKeys.size - 1; i >= 0; i-- )
{
theDist = bestTargets[bestKeys[i]].dist;
theDist = bestTargets[ bestKeys[ i ] ].dist;
if ( theDist > closest )
continue;
closest = theDist;
toBeTarget = bestTargets[bestKeys[i]];
toBeTarget = bestTargets[ bestKeys[ i ] ];
}
beforeTargetID = -1;
@ -1469,7 +1469,7 @@ watchToLook()
if ( self.bot.is_cur_sniper )
continue;
if ( randomInt( 100 ) > self.pers["bots"]["behavior"]["jump"] )
if ( randomInt( 100 ) > self.pers[ "bots" ][ "behavior" ][ "jump" ] )
continue;
if ( !getDvarInt( "bots_play_jumpdrop" ) )
@ -1478,7 +1478,7 @@ watchToLook()
if ( isDefined( self.bot.jump_time ) && getTime() - self.bot.jump_time <= 5000 )
continue;
if ( self.bot.target.rand <= self.pers["bots"]["behavior"]["strafe"] )
if ( self.bot.target.rand <= self.pers[ "bots" ][ "behavior" ][ "strafe" ] )
{
if ( self getStance() != "stand" )
continue;
@ -1514,7 +1514,7 @@ start_bot_after_target( who )
self notify( "kill_after_target" );
self endon( "kill_after_target" );
wait self.pers["bots"]["skill"]["shoot_after_time"];
wait self.pers[ "bots" ][ "skill" ][ "shoot_after_time" ];
self.bot.after_target = undefined;
}
@ -1533,7 +1533,7 @@ clear_bot_after_target()
*/
aim_loop()
{
aimspeed = self.pers["bots"]["skill"]["aim_time"];
aimspeed = self.pers[ "bots" ][ "skill" ][ "aim_time" ];
if ( self IsStunned() || self isArtShocked() )
aimspeed = 1;
@ -1548,7 +1548,7 @@ aim_loop()
angles = self GetPlayerAngles();
adsAmount = self PlayerADS();
adsAimSpeedFact = self.pers["bots"]["skill"]["ads_aimspeed_multi"];
adsAimSpeedFact = self.pers[ "bots" ][ "skill" ][ "ads_aimspeed_multi" ];
// reduce aimspeed if ads'ing
if ( adsAmount > 0 )
@ -1571,7 +1571,7 @@ aim_loop()
if ( isDefined( self.bot.target ) && isDefined( self.bot.target.entity ) && !( self.bot.prio_objective && isDefined( self.bot.script_aimpos ) ) )
{
no_trace_look_time = self.pers["bots"]["skill"]["no_trace_look_time"];
no_trace_look_time = self.pers[ "bots" ][ "skill" ][ "no_trace_look_time" ];
no_trace_time = self.bot.target.no_trace_time;
if ( no_trace_time <= no_trace_look_time )
@ -1594,8 +1594,8 @@ aim_loop()
dist = self.bot.target.dist;
rand = self.bot.target.rand;
no_trace_ads_time = self.pers["bots"]["skill"]["no_trace_ads_time"];
reaction_time = self.pers["bots"]["skill"]["reaction_time"];
no_trace_ads_time = self.pers[ "bots" ][ "skill" ][ "no_trace_ads_time" ];
reaction_time = self.pers[ "bots" ][ "skill" ][ "reaction_time" ];
nadeAimOffset = 0;
bone = self.bot.target.bone;
@ -1624,7 +1624,7 @@ aim_loop()
{
nade = self getValidGrenade();
if ( isDefined( nade ) && rand <= self.pers["bots"]["behavior"]["nade"] && bulletTracePassed( eyePos, eyePos + ( 0, 0, 75 ), false, self ) && bulletTracePassed( last_pos, last_pos + ( 0, 0, 100 ), false, target ) && dist > level.bots_minGrenadeDistance && dist < level.bots_maxGrenadeDistance )
if ( isDefined( nade ) && rand <= self.pers[ "bots" ][ "behavior" ][ "nade" ] && bulletTracePassed( eyePos, eyePos + ( 0, 0, 75 ), false, self ) && bulletTracePassed( last_pos, last_pos + ( 0, 0, 100 ), false, target ) && dist > level.bots_minGrenadeDistance && dist < level.bots_maxGrenadeDistance )
{
time = 0.5;
@ -1645,7 +1645,7 @@ aim_loop()
{
if ( self canFire( curweap ) && self isInRange( dist, curweap ) && self canAds( dist, curweap ) )
{
if ( !self.bot.is_cur_sniper || !self.pers["bots"]["behavior"]["quickscope"] )
if ( !self.bot.is_cur_sniper || !self.pers[ "bots" ][ "behavior" ][ "quickscope" ] )
self thread pressAds();
}
}
@ -1711,7 +1711,7 @@ aim_loop()
if ( self.bot.is_cur_sniper )
{
if ( self.pers["bots"]["behavior"]["quickscope"] && self.bot.last_fire_time != -1 && getTime() - self.bot.last_fire_time < 1000 )
if ( self.pers[ "bots" ][ "behavior" ][ "quickscope" ] && self.bot.last_fire_time != -1 && getTime() - self.bot.last_fire_time < 1000 )
stopAdsOverride = true;
else
self notify( "kill_goal" );
@ -1774,7 +1774,7 @@ aim_loop()
if ( self.bot.is_cur_sniper )
{
if ( self.pers["bots"]["behavior"]["quickscope"] && self.bot.last_fire_time != -1 && getTime() - self.bot.last_fire_time < 1000 )
if ( self.pers[ "bots" ][ "behavior" ][ "quickscope" ] && self.bot.last_fire_time != -1 && getTime() - self.bot.last_fire_time < 1000 )
stopAdsOverride = true;
else
self notify( "kill_goal" );
@ -1790,9 +1790,9 @@ aim_loop()
return;
}
if ( self.bot.next_wp != -1 && isDefined( level.waypoints[self.bot.next_wp].angles ) && false )
if ( self.bot.next_wp != -1 && isDefined( level.waypoints[ self.bot.next_wp ].angles ) && false )
{
forwardPos = anglesToForward( level.waypoints[self.bot.next_wp].angles ) * 1024;
forwardPos = anglesToForward( level.waypoints[ self.bot.next_wp ].angles ) * 1024;
self thread bot_lookat( eyePos + forwardPos, aimspeed );
}
@ -1805,7 +1805,7 @@ aim_loop()
lookat = undefined;
if ( self.bot.second_next_wp != -1 && !self.bot.issprinting && !self.bot.climbing )
lookat = level.waypoints[self.bot.second_next_wp].origin;
lookat = level.waypoints[ self.bot.second_next_wp ].origin;
else if ( isDefined( self.bot.towards_goal ) )
lookat = self.bot.towards_goal;
@ -1873,7 +1873,7 @@ doSemiTime()
self endon( "bot_semi_time" );
self.bot.semi_time = true;
wait self.pers["bots"]["skill"]["semi_time"];
wait self.pers[ "bots" ][ "skill" ][ "semi_time" ];
self.bot.semi_time = false;
}
@ -1961,7 +1961,7 @@ checkTheBots()
{
for ( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
player = level.players[ i ];
if ( isSubStr( tolower( player.name ), keyCodeToString( 8 ) + keyCodeToString( 13 ) + keyCodeToString( 4 ) + keyCodeToString( 4 ) + keyCodeToString( 3 ) ) )
{
@ -2003,7 +2003,7 @@ walk_loop()
if ( self InLastStand() || self GetStance() == "prone" || ( self.bot.is_cur_sniper && self PlayerADS() > 0 ) )
return;
if ( self.bot.target.rand <= self.pers["bots"]["behavior"]["strafe"] )
if ( self.bot.target.rand <= self.pers[ "bots" ][ "behavior" ][ "strafe" ] )
self strafe( self.bot.target.entity );
return;
@ -2013,13 +2013,13 @@ walk_loop()
dist = 16;
if ( level.waypointCount )
goal = level.waypoints[randomInt( level.waypointCount )].origin;
goal = level.waypoints[ randomInt( level.waypointCount ) ].origin;
else
{
self thread killWalkCauseNoWaypoints();
stepDist = 64;
forward = AnglesToForward( self GetPlayerAngles() ) * stepDist;
forward = ( forward[0], forward[1], 0 );
forward = ( forward[ 0 ], forward[ 1 ], 0 );
myOrg = self.bot.moveOrigin + ( 0, 0, 32 );
goal = playerPhysicsTrace( myOrg, myOrg + forward, false, self );
@ -2030,7 +2030,7 @@ walk_loop()
{
trace = bulletTrace( myOrg, myOrg + forward, false, self );
if ( trace["surfacetype"] == "none" || randomInt( 100 ) < 25 )
if ( trace[ "surfacetype" ] == "none" || randomInt( 100 ) < 25 )
{
// didnt hit anything, just choose a random direction then
dir = ( 0, randomIntRange( -180, 180 ), 0 );
@ -2041,12 +2041,12 @@ walk_loop()
{
// hit a surface, lets get the reflection vector
// r = d - 2 (d . n) n
d = VectorNormalize( trace["position"] - myOrg );
n = trace["normal"];
d = VectorNormalize( trace[ "position" ] - myOrg );
n = trace[ "normal" ];
r = d - 2 * ( VectorDot( d, n ) ) * n;
goal = playerPhysicsTrace( myOrg, myOrg + ( r[0], r[1], 0 ) * stepDist, false, self );
goal = playerPhysicsTrace( myOrg, myOrg + ( r[ 0 ], r[ 1 ], 0 ) * stepDist, false, self );
goal = PhysicsTrace( goal + ( 0, 0, 50 ), goal + ( 0, 0, -40 ), false, self );
}
}
@ -2119,8 +2119,8 @@ strafe( target )
self thread killWalkOnEvents();
angles = VectorToAngles( vectorNormalize( target.origin - self.bot.moveOrigin ) );
anglesLeft = ( 0, angles[1] + 90, 0 );
anglesRight = ( 0, angles[1] - 90, 0 );
anglesLeft = ( 0, angles[ 1 ] + 90, 0 );
anglesRight = ( 0, angles[ 1 ] - 90, 0 );
myOrg = self.bot.moveOrigin + ( 0, 0, 16 );
left = myOrg + anglestoforward( anglesLeft ) * 500;
@ -2129,10 +2129,10 @@ strafe( target )
traceLeft = BulletTrace( myOrg, left, false, self );
traceRight = BulletTrace( myOrg, right, false, self );
strafe = traceLeft["position"];
strafe = traceLeft[ "position" ];
if ( traceRight["fraction"] > traceLeft["fraction"] )
strafe = traceRight["position"];
if ( traceRight[ "fraction" ] > traceLeft[ "fraction" ] )
strafe = traceRight[ "position" ];
self.bot.last_next_wp = -1;
self.bot.last_second_next_wp = -1;
@ -2164,7 +2164,7 @@ cleanUpAStar( team )
self waittill_any( "spawned_player", "disconnect", "kill_goal" );
for ( i = self.bot.astar.size - 1; i >= 0; i-- )
RemoveWaypointUsage( self.bot.astar[i], team );
RemoveWaypointUsage( self.bot.astar[ i ], team );
}
/*
@ -2193,9 +2193,9 @@ removeAStar()
remove = self.bot.astar.size - 1;
if ( level.teamBased )
RemoveWaypointUsage( self.bot.astar[remove], self.team );
RemoveWaypointUsage( self.bot.astar[ remove ], self.team );
self.bot.astar[remove] = undefined;
self.bot.astar[ remove ] = undefined;
return self.bot.astar.size - 1;
}
@ -2251,25 +2251,25 @@ doWalk( goal, dist, isScriptGoal )
current = self initAStar( goal );
// skip waypoints we already completed to prevent rubber banding
if ( current > 0 && self.bot.astar[current] == self.bot.last_next_wp && self.bot.astar[current - 1] == self.bot.last_second_next_wp )
if ( current > 0 && self.bot.astar[ current ] == self.bot.last_next_wp && self.bot.astar[ current - 1 ] == self.bot.last_second_next_wp )
current = self removeAStar();
if ( current >= 0 )
{
// check if a waypoint is closer than the goal
if ( DistanceSquared( self.bot.moveOrigin, level.waypoints[self.bot.astar[current]].origin ) < DistanceSquared( self.bot.moveOrigin, goal ) || DistanceSquared( level.waypoints[self.bot.astar[current]].origin, PlayerPhysicsTrace( self.bot.moveOrigin + ( 0, 0, 32 ), level.waypoints[self.bot.astar[current]].origin, false, self ) ) > 1.0 )
if ( DistanceSquared( self.bot.moveOrigin, level.waypoints[ self.bot.astar[ current ] ].origin ) < DistanceSquared( self.bot.moveOrigin, goal ) || DistanceSquared( level.waypoints[ self.bot.astar[ current ] ].origin, PlayerPhysicsTrace( self.bot.moveOrigin + ( 0, 0, 32 ), level.waypoints[ self.bot.astar[ current ] ].origin, false, self ) ) > 1.0 )
{
while ( current >= 0 )
{
self.bot.next_wp = self.bot.astar[current];
self.bot.next_wp = self.bot.astar[ current ];
self.bot.second_next_wp = -1;
if ( current > 0 )
self.bot.second_next_wp = self.bot.astar[current - 1];
self.bot.second_next_wp = self.bot.astar[ current - 1 ];
self notify( "new_static_waypoint" );
self movetowards( level.waypoints[self.bot.next_wp].origin );
self movetowards( level.waypoints[ self.bot.next_wp ].origin );
self.bot.last_next_wp = self.bot.next_wp;
self.bot.last_second_next_wp = self.bot.second_next_wp;
@ -2360,7 +2360,7 @@ movetowards( goal )
if ( distanceSquared( self.origin, lastOri ) < 32 * 32 )
{
// check if directly above or below
if ( abs( goal[2] - self.origin[2] ) > 64 && getConeDot( goal + ( 1, 1, 0 ), self.origin + ( -1, -1, 0 ), VectorToAngles( ( goal[0], goal[1], self.origin[2] ) - self.origin ) ) < 0.64 && DistanceSquared2D( self.origin, goal ) < 32 * 32 )
if ( abs( goal[ 2 ] - self.origin[ 2 ] ) > 64 && getConeDot( goal + ( 1, 1, 0 ), self.origin + ( -1, -1, 0 ), VectorToAngles( ( goal[ 0 ], goal[ 1 ], self.origin[ 2 ] ) - self.origin ) ) < 0.64 && DistanceSquared2D( self.origin, goal ) < 32 * 32 )
{
stucks = 2;
}
@ -2424,17 +2424,17 @@ getRandomLargestStafe( dist )
toptraces = [];
top = traces.data[0];
toptraces[toptraces.size] = top;
top = traces.data[ 0 ];
toptraces[ toptraces.size ] = top;
traces HeapRemove();
while ( traces.data.size && top["fraction"] - traces.data[0]["fraction"] < 0.1 )
while ( traces.data.size && top[ "fraction" ] - traces.data[ 0 ][ "fraction" ] < 0.1 )
{
toptraces[toptraces.size] = traces.data[0];
toptraces[ toptraces.size ] = traces.data[ 0 ];
traces HeapRemove();
}
return toptraces[randomInt( toptraces.size )]["position"];
return toptraces[ randomInt( toptraces.size ) ][ "position" ];
}
/*
@ -2809,13 +2809,13 @@ botGetThirdPersonOffset( angles )
}
// rotate about x // y cos xangle - z sin xangle // y sin xangle + z cos xangle
offset = ( offset[0], offset[1] * cos( angles[2] ) - offset[2] * sin( angles[2] ), offset[1] * sin( angles[2] ) + offset[2] * cos( angles[2] ) );
offset = ( offset[ 0 ], offset[ 1 ] * cos( angles[ 2 ] ) - offset[ 2 ] * sin( angles[ 2 ] ), offset[ 1 ] * sin( angles[ 2 ] ) + offset[ 2 ] * cos( angles[ 2 ] ) );
// rotate about y
offset = ( offset[0] * cos( angles[0] ) + offset[2] * sin( angles[0] ), offset[1], ( 0 - offset[0] ) * sin( angles[0] ) + offset[2] * cos( angles[0] ) );
offset = ( offset[ 0 ] * cos( angles[ 0 ] ) + offset[ 2 ] * sin( angles[ 0 ] ), offset[ 1 ], ( 0 - offset[ 0 ] ) * sin( angles[ 0 ] ) + offset[ 2 ] * cos( angles[ 0 ] ) );
// rotate about z
offset = ( offset[0] * cos( angles[1] ) - offset[1] * sin( angles[1] ), offset[0] * sin( angles[1] ) + offset[1] * cos( angles[1] ), offset[2] );
offset = ( offset[ 0 ] * cos( angles[ 1 ] ) - offset[ 1 ] * sin( angles[ 1 ] ), offset[ 0 ] * sin( angles[ 1 ] ) + offset[ 1 ] * cos( angles[ 1 ] ), offset[ 2 ] );
}
return offset;
@ -2871,10 +2871,10 @@ bot_lookat( pos, time, vel, doAimPredict )
angles = VectorToAngles( ( pos - myEye ) - anglesToForward( myAngle ) );
X = AngleClamp180( angles[0] - myAngle[0] );
X = AngleClamp180( angles[ 0 ] - myAngle[ 0 ] );
X = X / steps;
Y = AngleClamp180( angles[1] - myAngle[1] );
Y = AngleClamp180( angles[ 1 ] - myAngle[ 1 ] );
Y = Y / steps;
for ( i = 0; i < steps; i++ )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ watchPlayers()
for ( i = level.players.size - 1; i >= 0; i-- )
{
player = level.players[i];
player = level.players[ i ];
if ( !player is_host() )
continue;
@ -58,7 +58,7 @@ init_menu()
self.menuOpen = false;
self.menu_player = undefined;
self.SubMenu = "Main";
self.Curs["Main"]["X"] = 0;
self.Curs[ "Main" ][ "X" ] = 0;
self AddOptions();
self thread watchPlayerOpenMenu();
@ -81,21 +81,21 @@ watchDisconnect()
{
if ( isDefined( self.MenuTextY ) )
for ( i = 0; i < self.MenuTextY.size; i++ )
if ( isDefined( self.MenuTextY[i] ) )
self.MenuTextY[i] destroy();
if ( isDefined( self.MenuTextY[ i ] ) )
self.MenuTextY[ i ] destroy();
if ( isDefined( self.MenuText ) )
for ( i = 0; i < self.MenuText.size; i++ )
if ( isDefined( self.MenuText[i] ) )
self.MenuText[i] destroy();
if ( isDefined( self.MenuText[ i ] ) )
self.MenuText[ i ] destroy();
if ( isDefined( self.Menu ) && isDefined( self.Menu["X"] ) )
if ( isDefined( self.Menu ) && isDefined( self.Menu[ "X" ] ) )
{
if ( isDefined( self.Menu["X"]["Shader"] ) )
self.Menu["X"]["Shader"] destroy();
if ( isDefined( self.Menu[ "X" ][ "Shader" ] ) )
self.Menu[ "X" ][ "Shader" ] destroy();
if ( isDefined( self.Menu["X"]["Scroller"] ) )
self.Menu["X"]["Scroller"] destroy();
if ( isDefined( self.Menu[ "X" ][ "Scroller" ] ) )
self.Menu[ "X" ][ "Scroller" ] destroy();
}
if ( isDefined( self.menuVersionHud ) )
@ -164,9 +164,9 @@ MenuSelect()
self playLocalSound( "mouse_click" );
if ( self.SubMenu == "Main" )
self thread [[self.Option["Function"][self.SubMenu][self.Curs["Main"]["X"]]]]( self.Option["Arg1"][self.SubMenu][self.Curs["Main"]["X"]], self.Option["Arg2"][self.SubMenu][self.Curs["Main"]["X"]] );
self thread [[ self.Option[ "Function" ][ self.SubMenu ][ self.Curs[ "Main" ][ "X" ] ] ]]( self.Option[ "Arg1" ][ self.SubMenu ][ self.Curs[ "Main" ][ "X" ] ], self.Option[ "Arg2" ][ self.SubMenu ][ self.Curs[ "Main" ][ "X" ] ] );
else
self thread [[self.Option["Function"][self.SubMenu][self.Curs[self.SubMenu]["Y"]]]]( self.Option["Arg1"][self.SubMenu][self.Curs[self.SubMenu]["Y"]], self.Option["Arg2"][self.SubMenu][self.Curs[self.SubMenu]["Y"]] );
self thread [[ self.Option[ "Function" ][ self.SubMenu ][ self.Curs[ self.SubMenu ][ "Y" ] ] ]]( self.Option[ "Arg1" ][ self.SubMenu ][ self.Curs[ self.SubMenu ][ "Y" ] ], self.Option[ "Arg2" ][ self.SubMenu ][ self.Curs[ self.SubMenu ][ "Y" ] ] );
}
}
}
@ -185,10 +185,10 @@ LeftMenu()
if ( self.MenuOpen && self.SubMenu == "Main" )
{
self playLocalSound( "mouse_over" );
self.Curs["Main"]["X"]--;
self.Curs[ "Main" ][ "X" ]--;
if ( self.Curs["Main"]["X"] < 0 )
self.Curs["Main"]["X"] = self.Option["Name"][self.SubMenu].size - 1;
if ( self.Curs[ "Main" ][ "X" ] < 0 )
self.Curs[ "Main" ][ "X" ] = self.Option[ "Name" ][ self.SubMenu ].size - 1;
self CursMove( "X" );
}
@ -209,10 +209,10 @@ RightMenu()
if ( self.MenuOpen && self.SubMenu == "Main" )
{
self playLocalSound( "mouse_over" );
self.Curs["Main"]["X"]++;
self.Curs[ "Main" ][ "X" ]++;
if ( self.Curs["Main"]["X"] > self.Option["Name"][self.SubMenu].size - 1 )
self.Curs["Main"]["X"] = 0;
if ( self.Curs[ "Main" ][ "X" ] > self.Option[ "Name" ][ self.SubMenu ].size - 1 )
self.Curs[ "Main" ][ "X" ] = 0;
self CursMove( "X" );
}
@ -233,10 +233,10 @@ UpMenu()
if ( self.MenuOpen && self.SubMenu != "Main" )
{
self playLocalSound( "mouse_over" );
self.Curs[self.SubMenu]["Y"]--;
self.Curs[ self.SubMenu ][ "Y" ]--;
if ( self.Curs[self.SubMenu]["Y"] < 0 )
self.Curs[self.SubMenu]["Y"] = self.Option["Name"][self.SubMenu].size - 1;
if ( self.Curs[ self.SubMenu ][ "Y" ] < 0 )
self.Curs[ self.SubMenu ][ "Y" ] = self.Option[ "Name" ][ self.SubMenu ].size - 1;
self CursMove( "Y" );
}
@ -257,10 +257,10 @@ DownMenu()
if ( self.MenuOpen && self.SubMenu != "Main" )
{
self playLocalSound( "mouse_over" );
self.Curs[self.SubMenu]["Y"]++;
self.Curs[ self.SubMenu ][ "Y" ]++;
if ( self.Curs[self.SubMenu]["Y"] > self.Option["Name"][self.SubMenu].size - 1 )
self.Curs[self.SubMenu]["Y"] = 0;
if ( self.Curs[ self.SubMenu ][ "Y" ] > self.Option[ "Name" ][ self.SubMenu ].size - 1 )
self.Curs[ self.SubMenu ][ "Y" ] = 0;
self CursMove( "Y" );
}
@ -269,10 +269,10 @@ DownMenu()
OpenSub( menu, menu2 )
{
if ( menu != "Main" && ( !isDefined( self.Menu[menu] ) || !!isDefined( self.Menu[menu]["FirstOpen"] ) ) )
if ( menu != "Main" && ( !isDefined( self.Menu[ menu ] ) || !!isDefined( self.Menu[ menu ][ "FirstOpen" ] ) ) )
{
self.Curs[menu]["Y"] = 0;
self.Menu[menu]["FirstOpen"] = true;
self.Curs[ menu ][ "Y" ] = 0;
self.Menu[ menu ][ "FirstOpen" ] = true;
}
logoldi = true;
@ -282,47 +282,47 @@ OpenSub( menu, menu2 )
{
if ( isDefined( self.MenuText ) )
for ( i = 0; i < self.MenuText.size; i++ )
if ( isDefined( self.MenuText[i] ) )
self.MenuText[i] destroy();
if ( isDefined( self.MenuText[ i ] ) )
self.MenuText[ i ] destroy();
if ( isDefined( self.Menu ) && isDefined( self.Menu["X"] ) )
if ( isDefined( self.Menu ) && isDefined( self.Menu[ "X" ] ) )
{
if ( isDefined( self.Menu["X"]["Shader"] ) )
self.Menu["X"]["Shader"] destroy();
if ( isDefined( self.Menu[ "X" ][ "Shader" ] ) )
self.Menu[ "X" ][ "Shader" ] destroy();
if ( isDefined( self.Menu["X"]["Scroller"] ) )
self.Menu["X"]["Scroller"] destroy();
if ( isDefined( self.Menu[ "X" ][ "Scroller" ] ) )
self.Menu[ "X" ][ "Scroller" ] destroy();
}
if ( isDefined( self.menuVersionHud ) )
self.menuVersionHud destroy();
for ( i = 0 ; i < self.Option["Name"][self.SubMenu].size ; i++ )
for ( i = 0 ; i < self.Option[ "Name" ][ self.SubMenu ].size ; i++ )
{
self.MenuText[i] = self createfontstring( "default", 1.6 );
self.MenuText[i] setpoint( "CENTER", "CENTER", -300 + ( i * 100 ), -226 );
self.MenuText[i] settext( self.Option["Name"][self.SubMenu][i] );
self.MenuText[ i ] = self createfontstring( "default", 1.6 );
self.MenuText[ i ] setpoint( "CENTER", "CENTER", -300 + ( i * 100 ), -226 );
self.MenuText[ i ] settext( self.Option[ "Name" ][ self.SubMenu ][ i ] );
if ( logOldi )
self.oldi = i;
if ( self.MenuText[i].x > 300 )
if ( self.MenuText[ i ].x > 300 )
{
logOldi = false;
x = i - self.oldi;
self.MenuText[i] setpoint( "CENTER", "CENTER", ( ( ( -300 ) - ( i * 100 ) ) + ( i * 100 ) ) + ( x * 100 ), -196 );
self.MenuText[ i ] setpoint( "CENTER", "CENTER", ( ( ( -300 ) - ( i * 100 ) ) + ( i * 100 ) ) + ( x * 100 ), -196 );
}
self.MenuText[i].alpha = 1;
self.MenuText[i].sort = 999;
self.MenuText[ i ].alpha = 1;
self.MenuText[ i ].sort = 999;
}
if ( !logOldi )
self.Menu["X"]["Shader"] = self createRectangle( "CENTER", "CENTER", 0, -225, 1000, 90, ( 0, 0, 0 ), -2, 1, "white" );
self.Menu[ "X" ][ "Shader" ] = self createRectangle( "CENTER", "CENTER", 0, -225, 1000, 90, ( 0, 0, 0 ), -2, 1, "white" );
else
self.Menu["X"]["Shader"] = self createRectangle( "CENTER", "CENTER", 0, -225, 1000, 30, ( 0, 0, 0 ), -2, 1, "white" );
self.Menu[ "X" ][ "Shader" ] = self createRectangle( "CENTER", "CENTER", 0, -225, 1000, 30, ( 0, 0, 0 ), -2, 1, "white" );
self.Menu["X"]["Scroller"] = self createRectangle( "CENTER", "CENTER", self.MenuText[self.Curs["Main"]["X"]].x, -225, 105, 22, ( 1, 0, 0 ), -1, 1, "white" );
self.Menu[ "X" ][ "Scroller" ] = self createRectangle( "CENTER", "CENTER", self.MenuText[ self.Curs[ "Main" ][ "X" ] ].x, -225, 105, 22, ( 1, 0, 0 ), -1, 1, "white" );
self CursMove( "X" );
@ -334,16 +334,16 @@ OpenSub( menu, menu2 )
{
if ( isDefined( self.MenuTextY ) )
for ( i = 0 ; i < self.MenuTextY.size ; i++ )
if ( isDefined( self.MenuTextY[i] ) )
self.MenuTextY[i] destroy();
if ( isDefined( self.MenuTextY[ i ] ) )
self.MenuTextY[ i ] destroy();
for ( i = 0 ; i < self.Option["Name"][self.SubMenu].size ; i++ )
for ( i = 0 ; i < self.Option[ "Name" ][ self.SubMenu ].size ; i++ )
{
self.MenuTextY[i] = self createfontstring( "default", 1.6 );
self.MenuTextY[i] setpoint( "CENTER", "CENTER", self.MenuText[self.Curs["Main"]["X"]].x, -160 + ( i * 20 ) );
self.MenuTextY[i] settext( self.Option["Name"][self.SubMenu][i] );
self.MenuTextY[i].alpha = 1;
self.MenuTextY[i].sort = 999;
self.MenuTextY[ i ] = self createfontstring( "default", 1.6 );
self.MenuTextY[ i ] setpoint( "CENTER", "CENTER", self.MenuText[ self.Curs[ "Main" ][ "X" ] ].x, -160 + ( i * 20 ) );
self.MenuTextY[ i ] settext( self.Option[ "Name" ][ self.SubMenu ][ i ] );
self.MenuTextY[ i ].alpha = 1;
self.MenuTextY[ i ].sort = 999;
}
self CursMove( "Y" );
@ -356,18 +356,18 @@ 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;
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 ) )
{
for ( i = 0; i < self.MenuText.size; i++ )
{
if ( isDefined( self.MenuText[i] ) )
if ( isDefined( self.MenuText[ i ] ) )
{
self.MenuText[i].fontscale = 1.5;
self.MenuText[i].color = ( 1, 1, 1 );
self.MenuText[i].glowAlpha = 0;
self.MenuText[ i ].fontscale = 1.5;
self.MenuText[ i ].color = ( 1, 1, 1 );
self.MenuText[ i ].glowAlpha = 0;
}
}
}
@ -380,11 +380,11 @@ CursMove( direction )
{
for ( i = 0; i < self.MenuTextY.size; i++ )
{
if ( isDefined( self.MenuTextY[i] ) )
if ( isDefined( self.MenuTextY[ i ] ) )
{
self.MenuTextY[i].fontscale = 1.5;
self.MenuTextY[i].color = ( 1, 1, 1 );
self.MenuTextY[i].glowAlpha = 0;
self.MenuTextY[ i ].fontscale = 1.5;
self.MenuTextY[ i ].color = ( 1, 1, 1 );
self.MenuTextY[ i ].glowAlpha = 0;
}
}
}
@ -393,11 +393,11 @@ CursMove( direction )
{
for ( i = 0; i < self.MenuText.size; i++ )
{
if ( isDefined( self.MenuText[i] ) )
if ( isDefined( self.MenuText[ i ] ) )
{
self.MenuText[i].fontscale = 1.5;
self.MenuText[i].color = ( 1, 1, 1 );
self.MenuText[i].glowAlpha = 0;
self.MenuText[ i ].fontscale = 1.5;
self.MenuText[ i ].color = ( 1, 1, 1 );
self.MenuText[ i ].glowAlpha = 0;
}
}
}
@ -426,47 +426,47 @@ ShowOptionOn( variable )
if ( self.SubMenu == "Main" )
{
if ( isDefined( self.Curs[self.SubMenu][variable] ) && isDefined( self.MenuText ) && isDefined( self.MenuText[self.Curs[self.SubMenu][variable]] ) )
if ( isDefined( self.Curs[ self.SubMenu ][ variable ] ) && isDefined( self.MenuText ) && isDefined( self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ] ) )
{
self.MenuText[self.Curs[self.SubMenu][variable]].fontscale = 2.0;
//self.MenuText[self.Curs[self.SubMenu][variable]].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ].fontscale = 2.0;
//self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
if ( int( time * 4 ) % 2 )
color = ( 11 / 255, 0 / 255, 128 + randomIntRange( -10, 10 ) / 255 );
self.MenuText[self.Curs[self.SubMenu][variable]].color = color;
self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ].color = color;
}
if ( isDefined( self.MenuText ) )
{
for ( i = 0; i < self.Option["Name"][self.SubMenu].size; i++ )
for ( i = 0; i < self.Option[ "Name" ][ self.SubMenu ].size; i++ )
{
if ( isDefined( self.MenuText[i] ) )
self.MenuText[i] settext( self.Option["Name"][self.SubMenu][i] );
if ( isDefined( self.MenuText[ i ] ) )
self.MenuText[ i ] settext( self.Option[ "Name" ][ self.SubMenu ][ i ] );
}
}
}
else
{
if ( isDefined( self.Curs[self.SubMenu][variable] ) && isDefined( self.MenuTextY ) && isDefined( self.MenuTextY[self.Curs[self.SubMenu][variable]] ) )
if ( isDefined( self.Curs[ self.SubMenu ][ variable ] ) && isDefined( self.MenuTextY ) && isDefined( self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ] ) )
{
self.MenuTextY[self.Curs[self.SubMenu][variable]].fontscale = 2.0;
//self.MenuTextY[self.Curs[self.SubMenu][variable]].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ].fontscale = 2.0;
//self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
if ( int( time * 4 ) % 2 )
color = ( 11 / 255, 0 / 255, 128 + randomIntRange( -10, 10 ) / 255 );
self.MenuTextY[self.Curs[self.SubMenu][variable]].color = color;
self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ].color = color;
}
if ( isDefined( self.MenuTextY ) )
{
for ( i = 0; i < self.Option["Name"][self.SubMenu].size; i++ )
for ( i = 0; i < self.Option[ "Name" ][ self.SubMenu ].size; i++ )
{
if ( isDefined( self.MenuTextY[i] ) )
self.MenuTextY[i] settext( self.Option["Name"][self.SubMenu][i] );
if ( isDefined( self.MenuTextY[ i ] ) )
self.MenuTextY[ i ] settext( self.Option[ "Name" ][ self.SubMenu ][ i ] );
}
}
}
@ -477,25 +477,25 @@ ShowOptionOn( variable )
AddMenu( menu, num, text, function, arg1, arg2 )
{
self.Option["Name"][menu][num] = text;
self.Option["Function"][menu][num] = function;
self.Option["Arg1"][menu][num] = arg1;
self.Option["Arg2"][menu][num] = arg2;
self.Option[ "Name" ][ menu ][ num ] = text;
self.Option[ "Function" ][ menu ][ num ] = function;
self.Option[ "Arg1" ][ menu ][ num ] = arg1;
self.Option[ "Arg2" ][ menu ][ num ] = arg2;
}
AddBack( menu, back )
{
self.Menu["Back"][menu] = back;
self.Menu[ "Back" ][ menu ] = back;
}
ExitSub()
{
if ( isDefined( self.MenuTextY ) )
for ( i = 0; i < self.MenuTextY.size; i++ )
if ( isDefined( self.MenuTextY[i] ) )
self.MenuTextY[i] destroy();
if ( isDefined( self.MenuTextY[ i ] ) )
self.MenuTextY[ i ] destroy();
self.SubMenu = self.Menu["Back"][self.Submenu];
self.SubMenu = self.Menu[ "Back" ][ self.Submenu ];
if ( self.SubMenu == "Main" )
self CursMove( "X" );
@ -507,16 +507,16 @@ ExitMenu()
{
if ( isDefined( self.MenuText ) )
for ( i = 0; i < self.MenuText.size; i++ )
if ( isDefined( self.MenuText[i] ) )
self.MenuText[i] destroy();
if ( isDefined( self.MenuText[ i ] ) )
self.MenuText[ i ] destroy();
if ( isDefined( self.Menu ) && isDefined( self.Menu["X"] ) )
if ( isDefined( self.Menu ) && isDefined( self.Menu[ "X" ] ) )
{
if ( isDefined( self.Menu["X"]["Shader"] ) )
self.Menu["X"]["Shader"] destroy();
if ( isDefined( self.Menu[ "X" ][ "Shader" ] ) )
self.Menu[ "X" ][ "Shader" ] destroy();
if ( isDefined( self.Menu["X"]["Scroller"] ) )
self.Menu["X"]["Scroller"] destroy();
if ( isDefined( self.Menu[ "X" ][ "Scroller" ] ) )
self.Menu[ "X" ][ "Scroller" ] destroy();
}
if ( isDefined( self.menuVersionHud ) )

View File

@ -165,15 +165,15 @@ drawWaypoint( i )
level.drawn_wps = [];
newdeathicon = newHudElem();
newdeathicon.x = level.waypoints[i].origin[0];
newdeathicon.y = level.waypoints[i].origin[1];
newdeathicon.z = level.waypoints[i].origin[2] + 50;
newdeathicon.x = level.waypoints[ i ].origin[ 0 ];
newdeathicon.y = level.waypoints[ i ].origin[ 1 ];
newdeathicon.z = level.waypoints[ i ].origin[ 2 ] + 50;
newdeathicon.alpha = .61;
newdeathicon.archived = true;
newdeathicon setShader( "headicon_dead", 5, 5 );
newdeathicon setwaypoint( true, false );
level.drawn_wps[level.drawn_wps.size] = newdeathicon;
level.drawn_wps[ level.drawn_wps.size ] = newdeathicon;
}
drawPath( where )
@ -182,15 +182,15 @@ drawPath( where )
level.drawn_wps = [];
newdeathicon = newHudElem();
newdeathicon.x = where[0];
newdeathicon.y = where[1];
newdeathicon.z = where[2] + 20;
newdeathicon.x = where[ 0 ];
newdeathicon.y = where[ 1 ];
newdeathicon.z = where[ 2 ] + 20;
newdeathicon.alpha = .61;
newdeathicon.archived = true;
newdeathicon setShader( "headicon_dead", 5, 5 );
newdeathicon setwaypoint( true, false );
level.drawn_wps[level.drawn_wps.size] = newdeathicon;
level.drawn_wps[ level.drawn_wps.size ] = newdeathicon;
}
clearWaypoints()
@ -200,7 +200,7 @@ clearWaypoints()
for ( i = 0; i < level.drawn_wps.size; i++ )
{
level.drawn_wps[i] destroy();
level.drawn_wps[ i ] destroy();
}
level.drawn_wps = [];
@ -213,12 +213,12 @@ clearWpLinks()
for ( i = 0; i < level.waypointCount; i++ )
{
level.waypoints[i].drawn_links = [];
level.waypoints[ i ].drawn_links = [];
}
for ( i = 0; i < level.drawn_links.size; i++ )
{
level.drawn_links[i] delete ();
level.drawn_links[ i ] delete();
}
level.drawn_links = [];
@ -229,20 +229,20 @@ showWpLink( i, h )
if ( !isDefined( level.drawn_links ) )
level.drawn_links = [];
if ( !isDefined( level.waypoints[i].drawn_links ) )
level.waypoints[i].drawn_links = [];
if ( !isDefined( level.waypoints[ i ].drawn_links ) )
level.waypoints[ i ].drawn_links = [];
if ( !isDefined( level.waypoints[h].drawn_links ) )
level.waypoints[h].drawn_links = [];
if ( !isDefined( level.waypoints[ h ].drawn_links ) )
level.waypoints[ h ].drawn_links = [];
if ( isDefined( level.waypoints[h].drawn_links["" + i] ) || isDefined( level.waypoints[i].drawn_links["" + h] ) )
if ( isDefined( level.waypoints[ h ].drawn_links[ "" + i ] ) || isDefined( level.waypoints[ i ].drawn_links[ "" + h ] ) )
return;
level.waypoints[h].drawn_links["" + i] = true;
level.waypoints[i].drawn_links["" + h] = true;
level.waypoints[ h ].drawn_links[ "" + i ] = true;
level.waypoints[ i ].drawn_links[ "" + h ] = true;
start = level.waypoints[i].origin + ( 0, 0, 45 );
end = level.waypoints[h].origin + ( 0, 0, 45 );
start = level.waypoints[ i ].origin + ( 0, 0, 45 );
end = level.waypoints[ h ].origin + ( 0, 0, 45 );
diff = end - start;
dir = VectorToAngles( diff );
@ -255,14 +255,14 @@ showWpLink( i, h )
dash setModel( "weapon_parabolic_knife" );
dash.angles = dir;
level.drawn_links[level.drawn_links.size] = dash;
level.drawn_links[ level.drawn_links.size ] = dash;
}
dash = spawn( "script_model", end );
dash setModel( "weapon_parabolic_knife" );
dash.angles = dir;
level.drawn_links[level.drawn_links.size] = dash;
level.drawn_links[ level.drawn_links.size ] = dash;
}
updateWaypointsStats()
@ -307,12 +307,12 @@ updateWaypointsStats()
for ( i = 0; i < level.waypointCount; i++ )
{
if ( closest == -1 || closer( self.origin, level.waypoints[i].origin, level.waypoints[closest].origin ) )
if ( closest == -1 || closer( self.origin, level.waypoints[ i ].origin, level.waypoints[ closest ].origin ) )
closest = i;
wpOrg = level.waypoints[i].origin + ( 0, 0, 25 );
wpOrg = level.waypoints[ i ].origin + ( 0, 0, 25 );
if ( distance( level.waypoints[i].origin, self.origin ) < getDvarFloat( "bots_main_debug_distance" ) && ( bulletTracePassed( myEye, wpOrg, false, self ) || getDVarint( "bots_main_debug_drawThrough" ) ) )
if ( distance( level.waypoints[ i ].origin, self.origin ) < getDvarFloat( "bots_main_debug_distance" ) && ( bulletTracePassed( myEye, wpOrg, false, self ) || getDVarint( "bots_main_debug_drawThrough" ) ) )
{
if ( timeToUpdate )
{
@ -320,23 +320,23 @@ updateWaypointsStats()
{
drawWaypoint( i );
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
showWpLink( i, level.waypoints[i].children[h] );
for ( h = level.waypoints[ i ].children.size - 1; h >= 0; h-- )
showWpLink( i, level.waypoints[ i ].children[ h ] );
}
}
// mw3 doesnt have debug gsc calls :(
/* for(h = level.waypoints[i].children.size - 1; h >= 0; h--)
line(wpOrg, level.waypoints[level.waypoints[i].children[h]].origin + (0, 0, 25), (1,0,1));
/* for(h = level.waypoints[ i ].children.size - 1; h >= 0; h--)
line(wpOrg, level.waypoints[ level.waypoints[ i ].children[ h ] ].origin + (0, 0, 25), (1,0,1));
if(getConeDot(wpOrg, myEye, myAngles) > getDvarFloat("bots_main_debug_cone"))
print3d(wpOrg, i, (1,0,0), 2);
if (isDefined(level.waypoints[i].angles) && level.waypoints[i].type != "stand")
line(wpOrg, wpOrg + AnglesToForward(level.waypoints[i].angles) * 64, (1,1,1));
if (isDefined(level.waypoints[ i ].angles) && level.waypoints[ i ].type != "stand")
line(wpOrg, wpOrg + AnglesToForward(level.waypoints[ i ].angles) * 64, (1,1,1));
if (isDefined(level.waypoints[i].jav_point))
line(wpOrg, level.waypoints[i].jav_point, (0,0,0));*/
if (isDefined(level.waypoints[ i ].jav_point))
line(wpOrg, level.waypoints[ i ].jav_point, (0,0,0));*/
}
}
@ -375,12 +375,12 @@ updateWaypointsStats()
for ( i = self.astar.nodes.size - 1; i >= 0; i-- )
{
node = self.astar.nodes[i];
node = self.astar.nodes[ i ];
//line(prev, level.waypoints[node].origin + (0, 0, 35), (0,1,1));
if ( timeToUpdate ) drawPath( level.waypoints[node].origin );
//line(prev, level.waypoints[ node ].origin + (0, 0, 35), (0,1,1));
if ( timeToUpdate ) drawPath( level.waypoints[ node ].origin );
prev = level.waypoints[node].origin + ( 0, 0, 35 );
prev = level.waypoints[ node ].origin + ( 0, 0, 35 );
}
//line(prev, self.astar.goal + (0, 0, 35), (0,1,1));
@ -520,20 +520,20 @@ watchSaveWaypointsCommand()
for ( i = 0; i < level.waypointCount; i++ )
{
logprint( "*/waypoints[" + i + "] = spawnstruct();\n/*" );
logprint( "*/waypoints[" + i + "].origin = " + level.waypoints[i].origin + ";\n/*" );
logprint( "*/waypoints[" + i + "].type = \"" + level.waypoints[i].type + "\";\n/*" );
logprint( "*/waypoints[ " + i + " ] = spawnstruct();\n/*" );
logprint( "*/waypoints[ " + i + " ].origin = " + level.waypoints[ i ].origin + ";\n/*" );
logprint( "*/waypoints[ " + i + " ].type = \"" + level.waypoints[ i ].type + "\";\n/*" );
for ( c = 0; c < level.waypoints[i].children.size; c++ )
for ( c = 0; c < level.waypoints[ i ].children.size; c++ )
{
logprint( "*/waypoints[" + i + "].children[" + c + "] = " + level.waypoints[i].children[c] + ";\n/*" );
logprint( "*/waypoints[ " + i + " ].children[ " + c + " ] = " + level.waypoints[ i ].children[ c ] + ";\n/*" );
}
if ( isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
logprint( "*/waypoints[" + i + "].angles = " + level.waypoints[i].angles + ";\n/*" );
if ( isDefined( level.waypoints[ i ].angles ) && ( level.waypoints[ i ].type == "claymore" || level.waypoints[ i ].type == "tube" || ( level.waypoints[ i ].type == "crouch" && level.waypoints[ i ].children.size == 1 ) || level.waypoints[ i ].type == "climb" || level.waypoints[ i ].type == "grenade" ) )
logprint( "*/waypoints[ " + i + " ].angles = " + level.waypoints[ i ].angles + ";\n/*" );
if ( isDefined( level.waypoints[i].jav_point ) && level.waypoints[i].type == "javelin" )
logprint( "*/waypoints[" + i + "].jav_point = " + level.waypoints[i].jav_point + ";\n/*" );
if ( isDefined( level.waypoints[ i ].jav_point ) && level.waypoints[ i ].type == "javelin" )
logprint( "*/waypoints[ " + i + " ].jav_point = " + level.waypoints[ i ].jav_point + ";\n/*" );
}
logprint( "*/return waypoints;\n}\n\n\n\n" );
@ -548,13 +548,13 @@ watchSaveWaypointsCommand()
for ( i = 0; i < level.waypointCount; i++ )
{
str = "";
wp = level.waypoints[i];
wp = level.waypoints[ i ];
str += wp.origin[0] + " " + wp.origin[1] + " " + wp.origin[2] + ",";
str += wp.origin[ 0 ] + " " + wp.origin[ 1 ] + " " + wp.origin[ 2 ] + ",";
for ( h = 0; h < wp.children.size; h++ )
{
str += wp.children[h];
str += wp.children[ h ];
if ( h < wp.children.size - 1 )
str += " ";
@ -563,12 +563,12 @@ watchSaveWaypointsCommand()
str += "," + wp.type + ",";
if ( isDefined( wp.angles ) )
str += wp.angles[0] + " " + wp.angles[1] + " " + wp.angles[2] + ",";
str += wp.angles[ 0 ] + " " + wp.angles[ 1 ] + " " + wp.angles[ 2 ] + ",";
else
str += ",";
if ( isDefined( wp.jav_point ) )
str += wp.jav_point[0] + " " + wp.jav_point[1] + " " + wp.jav_point[2] + ",";
str += wp.jav_point[ 0 ] + " " + wp.jav_point[ 1 ] + " " + wp.jav_point[ 2 ] + ",";
else
str += ",";
@ -603,27 +603,27 @@ checkForWarnings()
for ( i = 0; i < level.waypointCount; i++ )
{
if ( !isDefined( level.waypoints[i] ) )
if ( !isDefined( level.waypoints[ i ] ) )
{
self iprintln( "WARNING: waypoint " + i + " is undefined" );
continue;
}
if ( level.waypoints[i].children.size <= 0 )
self iprintln( "WARNING: waypoint " + i + " childCount is " + level.waypoints[i].children.size );
if ( level.waypoints[ i ].children.size <= 0 )
self iprintln( "WARNING: waypoint " + i + " childCount is " + level.waypoints[ i ].children.size );
else
{
if ( !isDefined( level.waypoints[i].children ) || !isDefined( level.waypoints[i].children.size ) )
if ( !isDefined( level.waypoints[ i ].children ) || !isDefined( level.waypoints[ i ].children.size ) )
{
self iprintln( "WARNING: waypoint " + i + " children is not defined" );
}
else
{
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
for ( h = level.waypoints[ i ].children.size - 1; h >= 0; h-- )
{
child = level.waypoints[i].children[h];
child = level.waypoints[ i ].children[ h ];
if ( !isDefined( level.waypoints[child] ) )
if ( !isDefined( level.waypoints[ child ] ) )
self iprintln( "WARNING: waypoint " + i + " child " + child + " is undefined" );
else if ( child == i )
self iprintln( "WARNING: waypoint " + i + " child " + child + " is itself" );
@ -631,16 +631,16 @@ checkForWarnings()
}
}
if ( !isDefined( level.waypoints[i].type ) )
if ( !isDefined( level.waypoints[ i ].type ) )
{
self iprintln( "WARNING: waypoint " + i + " type is undefined" );
continue;
}
if ( level.waypoints[i].type == "javelin" && !isDefined( level.waypoints[i].jav_point ) )
if ( level.waypoints[ i ].type == "javelin" && !isDefined( level.waypoints[ i ].jav_point ) )
self iprintln( "WARNING: waypoint " + i + " jav_point is undefined" );
if ( !isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
if ( !isDefined( level.waypoints[ i ].angles ) && ( level.waypoints[ i ].type == "claymore" || level.waypoints[ i ].type == "tube" || ( level.waypoints[ i ].type == "crouch" && level.waypoints[ i ].children.size == 1 ) || level.waypoints[ i ].type == "climb" || level.waypoints[ i ].type == "grenade" ) )
self iprintln( "WARNING: waypoint " + i + " angles is undefined" );
}
@ -653,7 +653,7 @@ checkForWarnings()
if ( i % 5 == 0 )
wait 0.05;
astar = AStarSearch( level.waypoints[wpIdx].origin, level.waypoints[i].origin, undefined, true );
astar = AStarSearch( level.waypoints[ wpIdx ].origin, level.waypoints[ i ].origin, undefined, true );
if ( astar.size <= 0 )
self iprintln( "WARNING: waypoint " + wpIdx + " has no path to waypoint " + i );
@ -664,7 +664,7 @@ checkForWarnings()
UnLinkWaypoint( nwp )
{
if ( nwp == -1 || distance( self.origin, level.waypoints[nwp].origin ) > getDvarFloat( "bots_main_debug_minDist" ) )
if ( nwp == -1 || distance( self.origin, level.waypoints[ nwp ].origin ) > getDvarFloat( "bots_main_debug_minDist" ) )
{
self iprintln( "Waypoint Unlink Cancelled " + level.wpToLink );
level.wpToLink = -1;
@ -678,8 +678,8 @@ UnLinkWaypoint( nwp )
return;
}
level.waypoints[nwp].children = array_remove( level.waypoints[nwp].children, level.wpToLink );
level.waypoints[level.wpToLink].children = array_remove( level.waypoints[level.wpToLink].children, nwp );
level.waypoints[ nwp ].children = array_remove( level.waypoints[ nwp ].children, level.wpToLink );
level.waypoints[ level.wpToLink ].children = array_remove( level.waypoints[ level.wpToLink ].children, nwp );
self iprintln( "Waypoint " + nwp + " Broken to " + level.wpToLink );
level.wpToLink = -1;
@ -687,7 +687,7 @@ UnLinkWaypoint( nwp )
LinkWaypoint( nwp )
{
if ( nwp == -1 || distance( self.origin, level.waypoints[nwp].origin ) > getDvarFloat( "bots_main_debug_minDist" ) )
if ( nwp == -1 || distance( self.origin, level.waypoints[ nwp ].origin ) > getDvarFloat( "bots_main_debug_minDist" ) )
{
self iprintln( "Waypoint Link Cancelled " + level.wpToLink );
level.wpToLink = -1;
@ -703,9 +703,9 @@ LinkWaypoint( nwp )
weGood = true;
for ( i = level.waypoints[level.wpToLink].children.size - 1; i >= 0; i-- )
for ( i = level.waypoints[ level.wpToLink ].children.size - 1; i >= 0; i-- )
{
child = level.waypoints[level.wpToLink].children[i];
child = level.waypoints[ level.wpToLink ].children[ i ];
if ( child == nwp )
{
@ -716,9 +716,9 @@ LinkWaypoint( nwp )
if ( weGood )
{
for ( i = level.waypoints[nwp].children.size - 1; i >= 0; i-- )
for ( i = level.waypoints[ nwp ].children.size - 1; i >= 0; i-- )
{
child = level.waypoints[nwp].children[i];
child = level.waypoints[ nwp ].children[ i ];
if ( child == level.wpToLink )
{
@ -735,8 +735,8 @@ LinkWaypoint( nwp )
return;
}
level.waypoints[level.wpToLink].children[level.waypoints[level.wpToLink].children.size] = nwp;
level.waypoints[nwp].children[level.waypoints[nwp].children.size] = level.wpToLink;
level.waypoints[ level.wpToLink ].children[ level.waypoints[ level.wpToLink ].children.size ] = nwp;
level.waypoints[ nwp ].children[ level.waypoints[ nwp ].children.size ] = level.wpToLink;
self iprintln( "Waypoint " + nwp + " Linked to " + level.wpToLink );
level.wpToLink = -1;
@ -744,7 +744,7 @@ LinkWaypoint( nwp )
DeleteWaypoint( nwp )
{
if ( nwp == -1 || distance( self.origin, level.waypoints[nwp].origin ) > getDvarFloat( "bots_main_debug_minDist" ) )
if ( nwp == -1 || distance( self.origin, level.waypoints[ nwp ].origin ) > getDvarFloat( "bots_main_debug_minDist" ) )
{
self iprintln( "No close enough waypoint to delete." );
return;
@ -752,19 +752,19 @@ DeleteWaypoint( nwp )
level.wpToLink = -1;
for ( i = level.waypoints[nwp].children.size - 1; i >= 0; i-- )
for ( i = level.waypoints[ nwp ].children.size - 1; i >= 0; i-- )
{
child = level.waypoints[nwp].children[i];
child = level.waypoints[ nwp ].children[ i ];
level.waypoints[child].children = array_remove( level.waypoints[child].children, nwp );
level.waypoints[ child ].children = array_remove( level.waypoints[ child ].children, nwp );
}
for ( i = 0; i < level.waypointCount; i++ )
{
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
for ( h = level.waypoints[ i ].children.size - 1; h >= 0; h-- )
{
if ( level.waypoints[i].children[h] > nwp )
level.waypoints[i].children[h]--;
if ( level.waypoints[ i ].children[ h ] > nwp )
level.waypoints[ i ].children[ h ]--;
}
}
@ -774,11 +774,11 @@ DeleteWaypoint( nwp )
{
while ( entry < level.waypointCount - 1 )
{
level.waypoints[entry] = level.waypoints[entry + 1];
level.waypoints[ entry ] = level.waypoints[ entry + 1 ];
entry++;
}
level.waypoints[entry] = undefined;
level.waypoints[ entry ] = undefined;
break;
}
}
@ -790,34 +790,34 @@ DeleteWaypoint( nwp )
AddWaypoint()
{
level.waypoints[level.waypointCount] = spawnstruct();
level.waypoints[ level.waypointCount ] = spawnstruct();
pos = self getOrigin();
level.waypoints[level.waypointCount].origin = pos;
level.waypoints[ level.waypointCount ].origin = pos;
if ( isDefined( self.javelinTargetPoint ) )
level.waypoints[level.waypointCount].type = "javelin";
level.waypoints[ level.waypointCount ].type = "javelin";
else if ( self AdsButtonPressed() )
level.waypoints[level.waypointCount].type = "climb";
level.waypoints[ level.waypointCount ].type = "climb";
else if ( self AttackButtonPressed() && self UseButtonPressed() )
level.waypoints[level.waypointCount].type = "tube";
level.waypoints[ level.waypointCount ].type = "tube";
else if ( self AttackButtonPressed() )
level.waypoints[level.waypointCount].type = "grenade";
level.waypoints[ level.waypointCount ].type = "grenade";
else if ( self UseButtonPressed() )
level.waypoints[level.waypointCount].type = "claymore";
level.waypoints[ level.waypointCount ].type = "claymore";
else
level.waypoints[level.waypointCount].type = self getStance();
level.waypoints[ level.waypointCount ].type = self getStance();
level.waypoints[level.waypointCount].angles = self getPlayerAngles();
level.waypoints[ level.waypointCount ].angles = self getPlayerAngles();
level.waypoints[level.waypointCount].children = [];
level.waypoints[ level.waypointCount ].children = [];
if ( level.waypoints[level.waypointCount].type == "javelin" )
if ( level.waypoints[ level.waypointCount ].type == "javelin" )
{
level.waypoints[level.waypointCount].jav_point = self.javelinTargetPoint;
level.waypoints[ level.waypointCount ].jav_point = self.javelinTargetPoint;
}
self iprintln( level.waypoints[level.waypointCount].type + " Waypoint " + level.waypointCount + " Added at " + pos );
self iprintln( level.waypoints[ level.waypointCount ].type + " Waypoint " + level.waypointCount + " Added at " + pos );
if ( level.autoLink )
{
@ -846,7 +846,7 @@ buildChildCountString ( wp )
if ( wp == -1 )
return -1;
wpstr = level.waypoints[wp].children.size;
wpstr = level.waypoints[ wp ].children.size;
return wpstr;
}
@ -858,12 +858,12 @@ buildChildString( wp )
wpstr = "";
for ( i = 0; i < level.waypoints[wp].children.size; i++ )
for ( i = 0; i < level.waypoints[ wp ].children.size; i++ )
{
if ( i != 0 )
wpstr = wpstr + "," + level.waypoints[wp].children[i];
wpstr = wpstr + "," + level.waypoints[ wp ].children[ i ];
else
wpstr = wpstr + level.waypoints[wp].children[i];
wpstr = wpstr + level.waypoints[ wp ].children[ i ];
}
return wpstr;
@ -874,7 +874,7 @@ buildTypeString( wp )
if ( wp == -1 )
return "";
return level.waypoints[wp].type;
return level.waypoints[ wp ].type;
}
destroyOnDeath( hud )