From 79817cc03ba265c0701f08f59be508b0cd512a22 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 11 Sep 2020 21:04:41 -0600 Subject: [PATCH] stop move --- userraw/maps/mp/bots/_bot_internal.gsc | 3 ++- userraw/maps/mp/bots/_bot_script.gsc | 13 +++++++------ userraw/maps/mp/bots/_bot_utility.gsc | 8 ++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/userraw/maps/mp/bots/_bot_internal.gsc b/userraw/maps/mp/bots/_bot_internal.gsc index dd42273..1791060 100644 --- a/userraw/maps/mp/bots/_bot_internal.gsc +++ b/userraw/maps/mp/bots/_bot_internal.gsc @@ -132,6 +132,7 @@ resetBotVars() self.bot.last_pos = self.origin; self.bot.moveTo = self.origin; self.bot.climbing = false; + self.bot.stop_move = false; self.bot.isfrozen = false; self.bot.isreloading = false; @@ -2000,7 +2001,7 @@ walk() self botMoveTo(self.origin); - if(self.bot.isfrozen) + if(self.bot.isfrozen || self.bot.stop_move) continue; if(self maps\mp\_flashgrenades::isFlashbanged()) diff --git a/userraw/maps/mp/bots/_bot_script.gsc b/userraw/maps/mp/bots/_bot_script.gsc index 6d74a09..095124c 100644 --- a/userraw/maps/mp/bots/_bot_script.gsc +++ b/userraw/maps/mp/bots/_bot_script.gsc @@ -1516,6 +1516,7 @@ bot_use_tube_think() } self SetScriptAimPos(loc); + self BotStopMoving(true); wait 1; self setSpawnWeapon(tube); @@ -1529,6 +1530,7 @@ bot_use_tube_think() } self ClearScriptAimPos(loc); + self BotStopMoving(false); } } @@ -1632,11 +1634,13 @@ bot_use_grenade_think() } self SetScriptAimPos(loc); + self BotStopMoving(true); wait 1; self throwBotGrenade(nade); self ClearScriptAimPos(loc); + self BotStopMoving(false); } } @@ -2696,9 +2700,6 @@ bot_killstreak_think() { if (streakName == "airdrop_mega" || streakName == "airdrop_sentry_minigun" || streakName == "airdrop") { - if (self HasScriptGoal() || self.bot_lock_goal) - continue; - if (streakName != "airdrop_mega" && level.littleBirds > 2) continue; @@ -2716,15 +2717,15 @@ bot_killstreak_think() if (!bulletTracePassed(forwardTrace["position"], forwardTrace["position"]+(0,0,2048), false, self) && self.pers["bots"]["skill"]["base"] > 3) continue; - self SetScriptGoal(self.origin, 16); + self BotStopMoving(true); if (self throwBotGrenade(ksWeap) != "grenade_fire") { - self ClearScriptGoal(); + self BotStopMoving(false); continue; } if (self waittill_any_timeout( 15, "new_goal", "crate_physics_done" ) != "new_goal") - self ClearScriptGoal(); + self BotStopMoving(false); } else { diff --git a/userraw/maps/mp/bots/_bot_utility.gsc b/userraw/maps/mp/bots/_bot_utility.gsc index afa8d35..c1f9095 100644 --- a/userraw/maps/mp/bots/_bot_utility.gsc +++ b/userraw/maps/mp/bots/_bot_utility.gsc @@ -41,6 +41,14 @@ BotPressAttack(time) self maps\mp\bots\_bot_internal::pressFire(time); } +BotStopMoving(what) +{ + self.bot.stop_move = what; + + if(what) + self notify("kill_goal"); +} + getValidTube() { weaps = self getweaponslistall();