From cef1ee2a661f3c8370a3613541ee2a48d226bad7 Mon Sep 17 00:00:00 2001 From: INeedBots Date: Wed, 25 Nov 2020 16:37:46 -0600 Subject: [PATCH] ok update to date with cod4 --- main_shared/maps/mp/bots/_bot.gsc | 21 +++++++- main_shared/maps/mp/bots/_bot_utility.gsc | 65 ++++++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/main_shared/maps/mp/bots/_bot.gsc b/main_shared/maps/mp/bots/_bot.gsc index 7a73c0f..9b5da76 100644 --- a/main_shared/maps/mp/bots/_bot.gsc +++ b/main_shared/maps/mp/bots/_bot.gsc @@ -8,7 +8,7 @@ */ init() { - level.bw_VERSION = "1.0.0"; + level.bw_VERSION = "2.0.0"; if(getDvar("bots_main") == "") setDvar("bots_main", true); @@ -58,6 +58,25 @@ init() setDvar("bots_loadout_reasonable", false); if(getDvar("bots_loadout_allow_op") == "")//allows jug, marty and laststand setDvar("bots_loadout_allow_op", true); + + if(getDvar("bots_play_move") == "")//bots move + setDvar("bots_play_move", true); + if(getDvar("bots_play_knife") == "")//bots knife + setDvar("bots_play_knife", true); + if(getDvar("bots_play_fire") == "")//bots fire + setDvar("bots_play_fire", true); + if(getDvar("bots_play_nade") == "")//bots grenade + setDvar("bots_play_nade", true); + if(getDvar("bots_play_obj") == "")//bots play the obj + setDvar("bots_play_obj", true); + if(getDvar("bots_play_camp") == "")//bots camp and follow + setDvar("bots_play_camp", true); + if(getDvar("bots_play_jumpdrop") == "")//bots jump and dropshot + 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(); diff --git a/main_shared/maps/mp/bots/_bot_utility.gsc b/main_shared/maps/mp/bots/_bot_utility.gsc index df770f0..6d752fd 100644 --- a/main_shared/maps/mp/bots/_bot_utility.gsc +++ b/main_shared/maps/mp/bots/_bot_utility.gsc @@ -338,6 +338,22 @@ isArtShocked() return (isDefined(self.beingArtilleryShellshocked) && self.beingArtilleryShellshocked); } +/* + If the player is carrying a bomb +*/ +isBombCarrier() +{ + return (isDefined(self.isBombCarrier) && self.isBombCarrier); +} + +/* + If the site is in use +*/ +isInUse() +{ + return (isDefined(self.inUse) && self.inUse); +} + /* Returns a valid grenade launcher weapon */ @@ -414,6 +430,53 @@ GetEyePos() return self getTagOrigin("tag_eye"); } +/* + Taken from iw4 script +*/ +waittill_any_timeout( timeOut, string1, string2, string3, string4, string5 ) +{ + if ( ( !isdefined( string1 ) || string1 != "death" ) && + ( !isdefined( string2 ) || string2 != "death" ) && + ( !isdefined( string3 ) || string3 != "death" ) && + ( !isdefined( string4 ) || string4 != "death" ) && + ( !isdefined( string5 ) || string5 != "death" ) ) + self endon( "death" ); + + ent = spawnstruct(); + + if ( isdefined( string1 ) ) + self thread waittill_string( string1, ent ); + + if ( isdefined( string2 ) ) + self thread waittill_string( string2, ent ); + + if ( isdefined( string3 ) ) + self thread waittill_string( string3, ent ); + + if ( isdefined( string4 ) ) + self thread waittill_string( string4, ent ); + + if ( isdefined( string5 ) ) + self thread waittill_string( string5, ent ); + + ent thread _timeout( timeOut ); + + ent waittill( "returned", msg ); + ent notify( "die" ); + return msg; +} + +/* + Used for waittill_any_timeout +*/ +_timeout( delay ) +{ + self endon( "die" ); + + wait( delay ); + self notify( "returned", "timeout" ); +} + /* Returns if we have the create a class object unlocked. */ @@ -1544,7 +1607,7 @@ AStarSearch(start, goal, team, greedy_path) // have certain types of nodes more expensive if (childtype == "climb" || childtype == "prone") - penalty++; + penalty += 4; //calc the total path we have took newg = bestNode.g + DistanceSquared(nodeorg, childorg)*penalty;//bots on same team's path are more expensive