CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 3
Call of Duty: Black Ops 3 Mods and Scripts
Call of Duty: Black Ops 3 Scripts
Create Bot AI for Zombies
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NightwalkerLots" data-source="post: 62425" data-attributes="member: 373162"><p><span style="font-size: 22px"><strong>Resources</strong></span></p><p></p><p><span style="font-size: 15px">//Needed for most of the function calls done on the bot</span></p><p>#include scripts\shared\bots\_bot;</p><p>#include scripts\shared\laststand_shared;</p><p></p><p>//GSC source for in-game bot code to reference how certain functions can be used</p><p><a href="https://github.com/shiversoftdev/t7-source/blob/07cbfcd113fb5031dc717296f73b371478d4eb77/scripts/shared/bots/_bot.gsc" target="_blank">t7-source/scripts/shared/bots/_bot.gsc at 07cbfcd113fb5031dc717296f73b371478d4eb77 · shiversoftdev/t7-source</a></p><p></p><p>//Video showcasing some bot behavior at work. To see what all is possible, or at least what I've done with bot ai so far.</p><p>[MEDIA=youtube]tjFumY8WxhQ[/MEDIA]</p><p></p><p></p><p><span style="font-size: 22px"><strong>Behavior</strong></span></p><p>First of all,</p><p>[CODE]add_bot() {</p><p> bot = AddTestClient();</p><p>}[/CODE]</p><p></p><p><span style="font-size: 15px">I won't reveal all I've made. But the simplest thing to get the bot to do is have them <strong><em>revive players</em></strong> because it's an in-game function.</span></p><p><span style="font-size: 15px">Here's just an example,</span></p><p></p><p>[CODE]Foreach( player in level.players ) {</p><p>if ( player laststand::player_is_in_laststand() ) { in_need = player; } else { in_need = undefined; }</p><p>if( player IsTestClient() ) { bot = player; }</p><p>if( isdefined( in_need ) ) { bot bot::revive_player(in_need); bot.is_reviving_player = true; }</p><p>}[/CODE]</p><p></p><p>Obviously, you can make more complex AI to prioritize reviving over other behaviors as I have. But something like this is actually what I started out with.</p><p>To fix bots going down, and being defined as both, I usually just have the bots in godmode to not have bugs with multiple of them running around.</p><p></p><p>This is a function I created to have a bot <strong><em>follow a player</em></strong>. The <strong>Canpath</strong> & <strong>BotSetGoal</strong> are built-in functions. Just don't forget the include I put at the top.</p><p>The Distance var is how close the bot needs to be to you for the bot to think he's reached his goal already. You could combine this with a looping function that makes the bot follow you but pauses if there is a downed player that needs to be revived. As the bot gets confused when trying to do both.</p><p></p><p>[CODE]ice_MoveBot_toPOS(bot, player, distance = 200) {</p><p> posb = bot.origin;</p><p> posp = player.origin;</p><p> if(!isDefined(bot)) return;</p><p> if(bot CanPath(posb, posp)) {</p><p> bot BotSetGoal(posp, distance);</p><p> player iPrintLnBold(bot.name + " is pathing to you...");</p><p> } else {</p><p> player iPrintLnBold("Bot Could Not find Path");</p><p> }</p><p>}[/CODE]</p><p></p><p>Getting the bot to <strong><em>path to a power-up</em></strong> is also pretty simple, as it is similar to using the function above except instead we're looking for the origin of the power-up.</p><p>This is a function I made to allow the bot to path to the closest power-up to them if one exists on the map.</p><p></p><p>[CODE]ice_bot_pathto_powerup(bot) { </p><p> if(bot.is_reviving_player == true) return;</p><p> if( level.active_powerups.size >= 1 && isDefined(level.active_powerups)) {</p><p> p_target = ArrayGetClosest(bot.origin, level.active_powerups);</p><p> wait 0.1;</p><p> ice_MoveBot_toPOS(bot, p_target, 0);</p><p> self iPrintLnBold("Bot is pathing to power up");</p><p> } else { self iPrintLnBold("No Current Powerups"); }</p><p>}[/CODE]</p><p></p><p>Just a few examples. Never seen people use this in a mod menu, and rarely on custom maps. But if you get really creative with it, you could essentially give the bots a real AI.</p><p>Another idea I've done to make the bots more useful is that all the points they earn go to each player in the game. Because while play testing a friend of mine was annoyed as the bot was pretty much robbing all the points.</p></blockquote><p></p>
[QUOTE="NightwalkerLots, post: 62425, member: 373162"] [SIZE=6][B]Resources[/B][/SIZE] [SIZE=4]//Needed for most of the function calls done on the bot[/SIZE] #include scripts\shared\bots\_bot; #include scripts\shared\laststand_shared; //GSC source for in-game bot code to reference how certain functions can be used [URL="https://github.com/shiversoftdev/t7-source/blob/07cbfcd113fb5031dc717296f73b371478d4eb77/scripts/shared/bots/_bot.gsc"]t7-source/scripts/shared/bots/_bot.gsc at 07cbfcd113fb5031dc717296f73b371478d4eb77 · shiversoftdev/t7-source[/URL] //Video showcasing some bot behavior at work. To see what all is possible, or at least what I've done with bot ai so far. [MEDIA=youtube]tjFumY8WxhQ[/MEDIA] [SIZE=6][B]Behavior[/B][/SIZE] First of all, [CODE]add_bot() { bot = AddTestClient(); }[/CODE] [SIZE=4]I won't reveal all I've made. But the simplest thing to get the bot to do is have them [B][I]revive players[/I][/B] because it's an in-game function. Here's just an example,[/SIZE] [CODE]Foreach( player in level.players ) { if ( player laststand::player_is_in_laststand() ) { in_need = player; } else { in_need = undefined; } if( player IsTestClient() ) { bot = player; } if( isdefined( in_need ) ) { bot bot::revive_player(in_need); bot.is_reviving_player = true; } }[/CODE] Obviously, you can make more complex AI to prioritize reviving over other behaviors as I have. But something like this is actually what I started out with. To fix bots going down, and being defined as both, I usually just have the bots in godmode to not have bugs with multiple of them running around. This is a function I created to have a bot [B][I]follow a player[/I][/B]. The [B]Canpath[/B] & [B]BotSetGoal[/B] are built-in functions. Just don't forget the include I put at the top. The Distance var is how close the bot needs to be to you for the bot to think he's reached his goal already. You could combine this with a looping function that makes the bot follow you but pauses if there is a downed player that needs to be revived. As the bot gets confused when trying to do both. [CODE]ice_MoveBot_toPOS(bot, player, distance = 200) { posb = bot.origin; posp = player.origin; if(!isDefined(bot)) return; if(bot CanPath(posb, posp)) { bot BotSetGoal(posp, distance); player iPrintLnBold(bot.name + " is pathing to you..."); } else { player iPrintLnBold("Bot Could Not find Path"); } }[/CODE] Getting the bot to [B][I]path to a power-up[/I][/B] is also pretty simple, as it is similar to using the function above except instead we're looking for the origin of the power-up. This is a function I made to allow the bot to path to the closest power-up to them if one exists on the map. [CODE]ice_bot_pathto_powerup(bot) { if(bot.is_reviving_player == true) return; if( level.active_powerups.size >= 1 && isDefined(level.active_powerups)) { p_target = ArrayGetClosest(bot.origin, level.active_powerups); wait 0.1; ice_MoveBot_toPOS(bot, p_target, 0); self iPrintLnBold("Bot is pathing to power up"); } else { self iPrintLnBold("No Current Powerups"); } }[/CODE] Just a few examples. Never seen people use this in a mod menu, and rarely on custom maps. But if you get really creative with it, you could essentially give the bots a real AI. Another idea I've done to make the bots more useful is that all the points they earn go to each player in the game. Because while play testing a friend of mine was annoyed as the bot was pretty much robbing all the points. [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 3
Call of Duty: Black Ops 3 Mods and Scripts
Call of Duty: Black Ops 3 Scripts
Create Bot AI for Zombies
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top