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); setDvar("bots_play_jumpdrop", true);
if(getDvar("bots_play_target_other") == "")//bot target non play ents (vehicles) if(getDvar("bots_play_target_other") == "")//bot target non play ents (vehicles)
setDvar("bots_play_target_other", true); setDvar("bots_play_target_other", true);
if(getDvar("bots_play_killstreak") == "")//bot use killstreaks
setDvar("bots_play_killstreak", true);
level.defuseObject = undefined; level.defuseObject = undefined;
level.bots_smokeList = List(); level.bots_smokeList = List();

View File

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

View File

@ -1286,7 +1286,8 @@ onSpawned()
self.bot_was_follow_script_update = undefined; self.bot_was_follow_script_update = undefined;
self.bot_stuck_on_carepackage = undefined; self.bot_stuck_on_carepackage = undefined;
self thread bot_dom_cap_think(); if (getDvarInt("bots_play_obj"))
self thread bot_dom_cap_think();
} }
} }
@ -1688,45 +1689,69 @@ start_bot_threads()
gameFlagWait("prematch_done"); gameFlagWait("prematch_done");
self thread bot_killstreak_think(); // inventory usage
if (getDvarInt("bots_play_killstreak"))
self thread bot_killstreak_think();
self thread bot_weapon_think(); self thread bot_weapon_think();
self thread bot_perk_think(); self thread bot_perk_think();
self thread bot_target_vehicle(); // script targeting
self thread bot_equipment_kill_think(); if (getDvarInt("bots_play_target_other"))
self thread bot_turret_think(); {
self thread bot_target_vehicle();
self thread bot_equipment_kill_think();
self thread bot_turret_think();
}
self thread bot_watch_stuck_on_crate(); // airdrop
self thread bot_crate_think(); if (getDvarInt("bots_play_take_carepackages"))
{
self thread bot_watch_stuck_on_crate();
self thread bot_crate_think();
}
// awareness
self thread bot_revenge_think(); self thread bot_revenge_think();
self thread bot_uav_think(); self thread bot_uav_think();
self thread bot_listen_to_steps(); self thread bot_listen_to_steps();
self thread follow_target(); self thread follow_target();
self thread bot_think_follow(); // camp and follow
self thread bot_think_camp(); if (getDvarInt("bots_play_camp"))
self thread bot_jav_loc_think(); {
self thread bot_use_grenade_think(); self thread bot_think_follow();
self thread bot_use_tube_think(); self thread bot_think_camp();
self thread bot_use_equipment_think(); }
self thread bot_watch_riot_weapons(); // nades
if (getDvarInt("bots_play_nade"))
{
self thread bot_jav_loc_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();
}
self thread bot_dom_def_think(); // obj
self thread bot_dom_spawn_kill_think(); if (getDvarInt("bots_play_obj"))
{
self thread bot_dom_def_think();
self thread bot_dom_spawn_kill_think();
self thread bot_hq(); self thread bot_hq();
self thread bot_cap(); self thread bot_cap();
self thread bot_sab(); self thread bot_sab();
self thread bot_sd_defenders(); self thread bot_sd_defenders();
self thread bot_sd_attackers(); self thread bot_sd_attackers();
self thread bot_dem_attackers(); self thread bot_dem_attackers();
self thread bot_dem_defenders(); self thread bot_dem_defenders();
}
} }
/* /*