mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-04-20 16:45:43 +00:00
Bump version 1.1.1
This commit is contained in:
parent
5bd1cb6448
commit
3537160233
@ -114,6 +114,13 @@ This mod extends the functionality and features of Combat Training in Black Ops
|
||||
- bots_main_waitForHostTime - a float value, how long in seconds to wait for the host player to connect before adding in bots
|
||||
|
||||
## Changelog
|
||||
- v1.1.1
|
||||
- Fixed some script runtime errors
|
||||
- Improved domination
|
||||
- Bots use altmode weapons
|
||||
- Improved revenge
|
||||
- Bots can swap weapons on spawn more likely
|
||||
|
||||
- v1.1.0
|
||||
- Rewrote using CoD4x as a base
|
||||
- Fixed bots not knifing
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
init()
|
||||
{
|
||||
level.bw_VERSION = "1.1.0";
|
||||
level.bw_VERSION = "1.1.1";
|
||||
|
||||
level.bot_offline = false;
|
||||
|
||||
|
@ -173,6 +173,7 @@ bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHi
|
||||
return;
|
||||
|
||||
self.killerLocation = undefined;
|
||||
self.lastKiller = undefined;
|
||||
if(!IsDefined( self ) || !isDefined(self.team))
|
||||
return;
|
||||
|
||||
@ -201,6 +202,7 @@ bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHi
|
||||
return;
|
||||
|
||||
self.killerLocation = eAttacker.origin;
|
||||
self.lastKiller = eAttacker;
|
||||
|
||||
if (!isSubStr(sWeapon, "_silencer_"))
|
||||
self bot_cry_for_help( eAttacker );
|
||||
@ -332,7 +334,10 @@ bot_spawn()
|
||||
self thread bot_radiation_think();
|
||||
|
||||
if (getDvarInt("bots_play_nade"))
|
||||
{
|
||||
self thread bot_use_equipment_think();
|
||||
self thread bot_watch_think_mw2();
|
||||
}
|
||||
|
||||
if (getDvarInt("bots_play_target_other"))
|
||||
{
|
||||
@ -686,6 +691,9 @@ changeToWeapon(weap)
|
||||
|
||||
self SwitchToWeapon(weap);
|
||||
|
||||
if (isWeaponAltmode(weap))
|
||||
self setSpawnWeapon(weap);
|
||||
|
||||
self waittill_any_timeout(5, "weapon_change");
|
||||
|
||||
return (self GetCurrentWeapon() == weap);
|
||||
@ -2457,7 +2465,7 @@ bot_dogs_think()
|
||||
}
|
||||
}
|
||||
|
||||
if ( dog.script_owner == self )
|
||||
if ( isDefined(dog.script_owner) && dog.script_owner == self )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -2527,6 +2535,53 @@ follow_target()
|
||||
}
|
||||
|
||||
/*
|
||||
Bots play mw2
|
||||
*/
|
||||
bot_watch_think_mw2()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
level endon("game_ended");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
wait randomIntRange(1, 4);
|
||||
|
||||
if(self isDefusing() || self isPlanting())
|
||||
continue;
|
||||
|
||||
if (self IsRemoteControlling())
|
||||
continue;
|
||||
|
||||
if (self InLastStand())
|
||||
continue;
|
||||
|
||||
if (isDefined(self GetThreat()))
|
||||
continue;
|
||||
|
||||
tube = self getValidTube();
|
||||
if (!isDefined(tube))
|
||||
{
|
||||
if (self GetAmmoCount("m72_law_mp"))
|
||||
tube = "m72_law_mp";
|
||||
else if (self GetAmmoCount("rpg_mp"))
|
||||
tube = "rpg_mp";
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
if (self GetCurrentWeapon() == tube)
|
||||
continue;
|
||||
|
||||
if (randomInt(100) > 35)
|
||||
continue;
|
||||
|
||||
self ChangeToWeapon(tube);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete
|
||||
Bots will think to switch weapons
|
||||
*/
|
||||
bot_weapon_think()
|
||||
@ -2535,6 +2590,8 @@ bot_weapon_think()
|
||||
self endon("disconnect");
|
||||
level endon("game_ended");
|
||||
|
||||
first = true;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill_any_timeout(randomIntRange(2, 4), "bot_force_check_switch");
|
||||
@ -2554,6 +2611,15 @@ bot_weapon_think()
|
||||
if (isDefined(threat) && !isPlayer(threat))
|
||||
continue;
|
||||
|
||||
if (first)
|
||||
{
|
||||
first = false;
|
||||
|
||||
if (randomInt(100) > 10)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "strela_mp")
|
||||
{
|
||||
if(randomInt(100) > 2)
|
||||
@ -2562,6 +2628,7 @@ bot_weapon_think()
|
||||
if(isDefined(threat))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
weaponslist = self getweaponslist();
|
||||
weap = "";
|
||||
@ -2573,7 +2640,7 @@ bot_weapon_think()
|
||||
if(!self getAmmoCount(weapon))
|
||||
continue;
|
||||
|
||||
if (!maps\mp\gametypes\_weapons::isPrimaryWeapon( weapon ) && !maps\mp\gametypes\_weapons::isSideArm( weapon ))
|
||||
if (!maps\mp\gametypes\_weapons::isPrimaryWeapon( weapon ) && !maps\mp\gametypes\_weapons::isSideArm( weapon ) && !isWeaponAltmode(weapon))
|
||||
continue;
|
||||
|
||||
if(curWeap == weapon || weapon == "none" || weapon == "" || weapon == "strela_mp")
|
||||
@ -2761,6 +2828,14 @@ bot_revenge_think()
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
|
||||
if (isDefined(self.lastKiller) && isAlive(self.lastKiller))
|
||||
{
|
||||
if(bulletTracePassed(self getEye(), self.lastKiller getTagOrigin( "j_spineupper" ), false, self.lastKiller))
|
||||
{
|
||||
self setAttacker(self.lastKiller);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isDefined(self.killerLocation))
|
||||
return;
|
||||
|
||||
@ -3094,6 +3169,8 @@ bot_dom_cap_think()
|
||||
|
||||
otherFlagCount = maps\mp\gametypes\dom::getTeamFlagCount( otherTeam );
|
||||
|
||||
if (game["teamScores"][myteam] >= game["teamScores"][otherTeam])
|
||||
{
|
||||
if ( myFlagCount < otherFlagCount )
|
||||
{
|
||||
if ( randomint( 100 ) < 15 )
|
||||
@ -3109,6 +3186,7 @@ bot_dom_cap_think()
|
||||
if ( randomint( 100 ) < 95 )
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
flag = undefined;
|
||||
flags = [];
|
||||
|
@ -145,6 +145,38 @@ GetBotDiffNum()
|
||||
return num;
|
||||
}
|
||||
|
||||
/*
|
||||
is the weapon alt mode?
|
||||
*/
|
||||
isWeaponAltmode(weap)
|
||||
{
|
||||
if (isStrStart(weap, "gl_") || isStrStart(weap, "ft_") || isStrStart(weap, "mk_"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns a valid grenade launcher weapon
|
||||
*/
|
||||
getValidTube()
|
||||
{
|
||||
weaps = self getweaponslist();
|
||||
|
||||
for (i = 0; i < weaps.size; i++)
|
||||
{
|
||||
weap = weaps[i];
|
||||
|
||||
if(!self getAmmoCount(weap))
|
||||
continue;
|
||||
|
||||
if ((isSubStr(weap, "gl_") && !isSubStr(weap, "_gl_")) || weap == "china_lake_mp")
|
||||
return weap;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/*
|
||||
Taken from iw4 script
|
||||
*/
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
init()
|
||||
{
|
||||
level.bw_VERSION = "1.1.0";
|
||||
level.bw_VERSION = "1.1.1";
|
||||
|
||||
level.bot_offline = false;
|
||||
|
||||
|
@ -173,6 +173,7 @@ bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHi
|
||||
return;
|
||||
|
||||
self.killerLocation = undefined;
|
||||
self.lastKiller = undefined;
|
||||
if(!IsDefined( self ) || !isDefined(self.team))
|
||||
return;
|
||||
|
||||
@ -201,6 +202,7 @@ bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHi
|
||||
return;
|
||||
|
||||
self.killerLocation = eAttacker.origin;
|
||||
self.lastKiller = eAttacker;
|
||||
|
||||
if (!isSubStr(sWeapon, "_silencer_"))
|
||||
self bot_cry_for_help( eAttacker );
|
||||
@ -332,7 +334,10 @@ bot_spawn()
|
||||
self thread bot_radiation_think();
|
||||
|
||||
if (getDvarInt("bots_play_nade"))
|
||||
{
|
||||
self thread bot_use_equipment_think();
|
||||
self thread bot_watch_think_mw2();
|
||||
}
|
||||
|
||||
if (getDvarInt("bots_play_target_other"))
|
||||
{
|
||||
@ -686,6 +691,9 @@ changeToWeapon(weap)
|
||||
|
||||
self SwitchToWeapon(weap);
|
||||
|
||||
if (isWeaponAltmode(weap))
|
||||
self setSpawnWeapon(weap);
|
||||
|
||||
self waittill_any_timeout(5, "weapon_change");
|
||||
|
||||
return (self GetCurrentWeapon() == weap);
|
||||
@ -2457,7 +2465,7 @@ bot_dogs_think()
|
||||
}
|
||||
}
|
||||
|
||||
if ( dog.script_owner == self )
|
||||
if ( isDefined(dog.script_owner) && dog.script_owner == self )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -2527,6 +2535,53 @@ follow_target()
|
||||
}
|
||||
|
||||
/*
|
||||
Bots play mw2
|
||||
*/
|
||||
bot_watch_think_mw2()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
level endon("game_ended");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
wait randomIntRange(1, 4);
|
||||
|
||||
if(self isDefusing() || self isPlanting())
|
||||
continue;
|
||||
|
||||
if (self IsRemoteControlling())
|
||||
continue;
|
||||
|
||||
if (self InLastStand())
|
||||
continue;
|
||||
|
||||
if (isDefined(self GetThreat()))
|
||||
continue;
|
||||
|
||||
tube = self getValidTube();
|
||||
if (!isDefined(tube))
|
||||
{
|
||||
if (self GetAmmoCount("m72_law_mp"))
|
||||
tube = "m72_law_mp";
|
||||
else if (self GetAmmoCount("rpg_mp"))
|
||||
tube = "rpg_mp";
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
if (self GetCurrentWeapon() == tube)
|
||||
continue;
|
||||
|
||||
if (randomInt(100) > 35)
|
||||
continue;
|
||||
|
||||
self ChangeToWeapon(tube);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete
|
||||
Bots will think to switch weapons
|
||||
*/
|
||||
bot_weapon_think()
|
||||
@ -2535,6 +2590,8 @@ bot_weapon_think()
|
||||
self endon("disconnect");
|
||||
level endon("game_ended");
|
||||
|
||||
first = true;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill_any_timeout(randomIntRange(2, 4), "bot_force_check_switch");
|
||||
@ -2554,6 +2611,15 @@ bot_weapon_think()
|
||||
if (isDefined(threat) && !isPlayer(threat))
|
||||
continue;
|
||||
|
||||
if (first)
|
||||
{
|
||||
first = false;
|
||||
|
||||
if (randomInt(100) > 10)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "strela_mp")
|
||||
{
|
||||
if(randomInt(100) > 2)
|
||||
@ -2562,6 +2628,7 @@ bot_weapon_think()
|
||||
if(isDefined(threat))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
weaponslist = self getweaponslist();
|
||||
weap = "";
|
||||
@ -2573,7 +2640,7 @@ bot_weapon_think()
|
||||
if(!self getAmmoCount(weapon))
|
||||
continue;
|
||||
|
||||
if (!maps\mp\gametypes\_weapons::isPrimaryWeapon( weapon ) && !maps\mp\gametypes\_weapons::isSideArm( weapon ))
|
||||
if (!maps\mp\gametypes\_weapons::isPrimaryWeapon( weapon ) && !maps\mp\gametypes\_weapons::isSideArm( weapon ) && !isWeaponAltmode(weapon))
|
||||
continue;
|
||||
|
||||
if(curWeap == weapon || weapon == "none" || weapon == "" || weapon == "strela_mp")
|
||||
@ -2761,6 +2828,14 @@ bot_revenge_think()
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
|
||||
if (isDefined(self.lastKiller) && isAlive(self.lastKiller))
|
||||
{
|
||||
if(bulletTracePassed(self getEye(), self.lastKiller getTagOrigin( "j_spineupper" ), false, self.lastKiller))
|
||||
{
|
||||
self setAttacker(self.lastKiller);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isDefined(self.killerLocation))
|
||||
return;
|
||||
|
||||
@ -3094,6 +3169,8 @@ bot_dom_cap_think()
|
||||
|
||||
otherFlagCount = maps\mp\gametypes\dom::getTeamFlagCount( otherTeam );
|
||||
|
||||
if (game["teamScores"][myteam] >= game["teamScores"][otherTeam])
|
||||
{
|
||||
if ( myFlagCount < otherFlagCount )
|
||||
{
|
||||
if ( randomint( 100 ) < 15 )
|
||||
@ -3109,6 +3186,7 @@ bot_dom_cap_think()
|
||||
if ( randomint( 100 ) < 95 )
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
flag = undefined;
|
||||
flags = [];
|
||||
|
@ -145,6 +145,38 @@ GetBotDiffNum()
|
||||
return num;
|
||||
}
|
||||
|
||||
/*
|
||||
is the weapon alt mode?
|
||||
*/
|
||||
isWeaponAltmode(weap)
|
||||
{
|
||||
if (isStrStart(weap, "gl_") || isStrStart(weap, "ft_") || isStrStart(weap, "mk_"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns a valid grenade launcher weapon
|
||||
*/
|
||||
getValidTube()
|
||||
{
|
||||
weaps = self getweaponslist();
|
||||
|
||||
for (i = 0; i < weaps.size; i++)
|
||||
{
|
||||
weap = weaps[i];
|
||||
|
||||
if(!self getAmmoCount(weap))
|
||||
continue;
|
||||
|
||||
if ((isSubStr(weap, "gl_") && !isSubStr(weap, "_gl_")) || weap == "china_lake_mp")
|
||||
return weap;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/*
|
||||
Taken from iw4 script
|
||||
*/
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
init()
|
||||
{
|
||||
level.bw_VERSION = "1.1.0";
|
||||
level.bw_VERSION = "1.1.1";
|
||||
|
||||
level.bot_offline = false;
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,6 +13,13 @@ You can find the more information at the Git Repo: https://github.com/ineedbots/
|
||||
4. The mod is now loaded! Go play Combat Training and enjoy the new additions.
|
||||
|
||||
## Changelog
|
||||
- v1.1.1
|
||||
- Fixed some script runtime errors
|
||||
- Improved domination
|
||||
- Bots use altmode weapons
|
||||
- Improved revenge
|
||||
- Bots can swap weapons on spawn more likely
|
||||
|
||||
- v1.1.0
|
||||
- Rewrote using CoD4x as a base
|
||||
- Fixed bots not knifing
|
||||
|
BIN
out/ss.png
BIN
out/ss.png
Binary file not shown.
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 4.8 MiB |
Loading…
x
Reference in New Issue
Block a user