Added dvars

This commit is contained in:
INeedBots 2020-11-23 00:42:44 -06:00
parent d2e563cf65
commit 5e7f456a42
3 changed files with 65 additions and 29 deletions

View File

@ -83,6 +83,8 @@ init()
setDvar("bots_play_jumpdrop", true);
if(getDvar("bots_play_target_other") == "")//bot target non play ents (vehicles)
setDvar("bots_play_target_other", true);
if(getDvar("bots_play_killstreak") == "")//bot use killstreaks
setDvar("bots_play_killstreak", true);
level.defuseObject = undefined;
level.bots_smokeList = List();

View File

@ -463,6 +463,9 @@ grenade_danager()
if(self isDefusing() || self isPlanting())
continue;
if (!getDvarInt("bots_play_nade"))
continue;
myEye = self getEye();
for (i = level.bots_fragList.count-1; i >= 0; i--)
{
@ -972,6 +975,9 @@ watchToLook()
if(randomInt(100) > self.pers["bots"]["behavior"]["jump"])
continue;
if (!getDvarInt("bots_play_jumpdrop"))
continue;
thetime = getTime();
if(isDefined(self.bot.jump_time) && thetime - self.bot.jump_time <= 5000)
continue;
@ -1060,7 +1066,7 @@ aim()
self thread bot_lookat(aimpos, aimspeed);
self thread pressAds();
if (curweap == "javelin_mp")
if (curweap == "javelin_mp" && getDvarInt("bots_play_fire"))
self botFire(curweap);
continue;
}
@ -1108,7 +1114,7 @@ aim()
if(isplay)
{
//better room to nade? cook time function with dist?
if(!self.bot.isfraggingafter && !self.bot.issmokingafter)
if(!self.bot.isfraggingafter && !self.bot.issmokingafter && getDvarInt("bots_play_nade"))
{
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)
@ -1174,7 +1180,7 @@ aim()
knifeDist = level.bots_maxKnifeDistance;
if (self _hasPerk("specialty_extendedmelee"))
knifeDist *= 1.4;
if((isplay || target.classname == "misc_turret") && !self.bot.isknifingafter && conedot > 0.9 && dist < knifeDist && trace_time > reaction_time && !usingRemote)
if((isplay || target.classname == "misc_turret") && !self.bot.isknifingafter && conedot > 0.9 && dist < knifeDist && trace_time > reaction_time && !usingRemote && getDvarInt("bots_play_knife"))
{
self clear_bot_after_target();
self thread knife();
@ -1193,7 +1199,7 @@ aim()
if (trace_time > reaction_time)
{
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance))
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance) && getDvarInt("bots_play_fire"))
self botFire(curweap);
if (isplay)
@ -1230,7 +1236,7 @@ aim()
if (canADS)
self thread pressAds();
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance))
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance) && getDvarInt("bots_play_fire"))
self botFire(curweap);
continue;
@ -1389,6 +1395,9 @@ walk()
self botMoveTo(self.origin);
if (!getDVarINt("bots_play_move"))
continue;
if(level.gameEnded || !gameFlag( "prematch_done" ) || self.bot.isfrozen || self.bot.stop_move)
continue;

View File

@ -1286,6 +1286,7 @@ onSpawned()
self.bot_was_follow_script_update = undefined;
self.bot_stuck_on_carepackage = undefined;
if (getDvarInt("bots_play_obj"))
self thread bot_dom_cap_think();
}
}
@ -1688,31 +1689,54 @@ start_bot_threads()
gameFlagWait("prematch_done");
// inventory usage
if (getDvarInt("bots_play_killstreak"))
self thread bot_killstreak_think();
self thread bot_weapon_think();
self thread bot_perk_think();
// script targeting
if (getDvarInt("bots_play_target_other"))
{
self thread bot_target_vehicle();
self thread bot_equipment_kill_think();
self thread bot_turret_think();
}
// airdrop
if (getDvarInt("bots_play_take_carepackages"))
{
self thread bot_watch_stuck_on_crate();
self thread bot_crate_think();
self thread bot_revenge_think();
}
// awareness
self thread bot_revenge_think();
self thread bot_uav_think();
self thread bot_listen_to_steps();
self thread follow_target();
// camp and follow
if (getDvarInt("bots_play_camp"))
{
self thread bot_think_follow();
self thread bot_think_camp();
}
// nades
if (getDvarInt("bots_play_nade"))
{
self thread bot_jav_loc_think();
self thread bot_use_grenade_think();
self thread bot_use_tube_think();
self thread bot_use_grenade_think();
self thread bot_use_equipment_think();
self thread bot_watch_riot_weapons();
}
// obj
if (getDvarInt("bots_play_obj"))
{
self thread bot_dom_def_think();
self thread bot_dom_spawn_kill_think();
@ -1728,6 +1752,7 @@ start_bot_threads()
self thread bot_dem_attackers();
self thread bot_dem_defenders();
}
}
/*
Clears goal when events death