Call of Duty: Black Ops III

Call of Duty: Black Ops III

Team Bots for ZM
WarpSpider  [developer] 10 Oct, 2019 @ 12:05am
Source Code
This is outdated as of 10/14/2019
function init() or main() or whatever() { ......zombie_utility::set_zombie_var("zombie_health_increase_multiplier",0,true); //after round 10 multiply the zombies' starting health by this amount zombie_utility::set_zombie_var( "game_start_delay",5,false); // How much time to give people a break before starting spawning thread friend(); }
...
function friend() { level endon( "game_ended" ); level flag::wait_till("initial_blackscreen_passed"); player = thread mplayer(); num = 0; player thread startText(); while(1) { if(num==0 && player ActionSlotThreeButtonPressed()) { player thread startText(); wait(.5); } if(num==0 && player ActionSlotFourButtonPressed()) { bot1 = addTestClient(); IPrintLnBold("^3"+bot1.name+" ^7will join next round"); bot1 thread bgoal(); wait(.5); num=1; } if(num==1 && player ActionSlotFourButtonPressed()) { bot2 = addTestClient(); IPrintLnBold("^2"+bot2.name+" ^7will join next round"); bot2 thread bgoal(); wait(.5); num=2; } if(num==2 && player ActionSlotFourButtonPressed()) { bot3 = addTestClient(); IPrintLnBold("^1"+bot3.name+" ^7will join next round"); bot3 thread bgoal(); wait(.5); num=3; } if(num==3 && player ActionSlotThreeButtonPressed()) { IPrintLnBold("^1"+bot3.name+" ^7has left"); bot3 BotDropClient(); wait(.5); num=2; } if(num==2 && player ActionSlotThreeButtonPressed()) { IPrintLnBold("^2"+bot2.name+" ^7has left"); bot2 BotDropClient(); wait(.5); num=1; } if(num==1 && player ActionSlotThreeButtonPressed()) { IPrintLnBold("^3"+bot1.name+" ^7has left"); bot1 BotDropClient(); wait(.5); num=0; } wait(.05); } } function mplayer() { level endon( "game_ended" ); mhost = 0; playersall = GetPlayers(); foreach(player in playersall) { if(player isHost()) { mhost = player; } return mhost; } } function startText() { text = NewClientHudElem(self); text.alignX = "center"; text.alignY = "bottom"; text.horzAlign = "user_center"; text.vertAlign = "user_bottom"; text.foreground = true; text.hidewheninmenu = false; text.font = "default"; text.fontScale = 1.8; text.alpha = 1; text.color = ( 1.0, 1.0, 1.0 ); text SetText("^9--Instructions--\n^7Press ^3[{+actionslot 4}] ^7to summon an ally\nPress ^3[{+actionslot 3}] ^7to dismiss an ally\n^7Press ^3[{+smoke}] ^7for bots to camp\nPress ^3[{+actionslot 4}] ^7for bots to stay close"); text.y = -113; if( self IsSplitScreen()) { text.y = -137; } text FadeOverTime(9); text.alpha = 0.1; wait(9); text Destroy(); } function bgoal() { level endon( "game_ended" ); self endon( "end_of_round" ); player = thread mplayer(); while(1) { self SetMaxHealth(1000); wait(1); if(isdefined(player.revivetrigger)) { self BotSetGoal(player.origin,1); player.revivetrigger waitTill("trigger"); player StartRevive(self); wait(2); player zm_laststand::revive_success(self); player StopRevive(self); player AllowJump(true); wait(.05); } else { self BotSetGoal(player.origin+(0,-72,0),72); weap1 = player GetCurrentWeapon(); weap2 = player GetCurrentWeaponAltWeapon(); self TakeAllWeapons(); self giveWeapon(weap1); self giveWeapon(weap2); self switchToWeapon(weap1); } if(player SecondaryOffhandButtonPressed()) { IPrintLnBold("^8Allies will now camp"); wait(1); while(1) { self BotSetGoal(self.origin,6); if(player ActionSlotFourButtonPressed()) { IPrintLnBold("^8Allies will now stay close"); break; } else { wait(.1); }} } weap3 = self GetCurrentWeapon(); self giveMaxAmmo(weap3); wait(.5); } }
Last edited by WarpSpider; 14 Oct, 2019 @ 8:16pm
< >
Showing 1-15 of 16 comments
WarpSpider  [developer] 10 Oct, 2019 @ 12:07am 
another idea i had was to change the name of the bots to the character that they are...but I don't know the code how to do that.
Clix 10 Oct, 2019 @ 5:56am 
SOURCE CODE yeahhhh dude ! go test somes ideas :smirk:
TheSupremeTaco 11 Oct, 2019 @ 11:31pm 
Where do I put this code in what file?
WarpSpider  [developer] 12 Oct, 2019 @ 12:22am 
Originally posted by TheSupremeTacoBoy:
Where do I put this code in what file?
If it's a mod, put it in the override(spoof) file. I use a copy of "_zm_perk_quick_revive.gsc" to do the override spoof.
If it's a map, you can put it in your main "zm_mapname.gsc".
Last edited by WarpSpider; 12 Oct, 2019 @ 12:22am
TheSupremeTaco 12 Oct, 2019 @ 3:18am 
Originally posted by WarpSpider:
Originally posted by TheSupremeTacoBoy:
Where do I put this code in what file?
If it's a mod, put it in the override(spoof) file. I use a copy of "_zm_perk_quick_revive.gsc" to do the override spoof.
If it's a map, you can put it in your main "zm_mapname.gsc".
Thx, got it working on a test map, but what is the override(spoof) file if I want to put on a mod
WarpSpider  [developer] 12 Oct, 2019 @ 3:46am 
I use the modded file i mentioned in quotes instead of the original...the location of this modded file is put into the zone file with the correct folder structure..some would say the code is injected in that way, spoofed, overidden, whatever you want to call it.
WarpSpider  [developer] 12 Oct, 2019 @ 3:36pm 
Posting the old version here
function friend() { level endon( "game_ended" ); level flag::wait_till("initial_blackscreen_passed"); //start_zombie_round_logic bot1 = addTestClient(); bot2 = addTestClient(); bot3 = addTestClient(); IPrintLnBold("^3The others must wait for round 2"); while(1) { bot1 thread b1goal(); wait(3); bot2 thread b2goal(); wait(3); bot3 thread b3goal(); level waittill("start_of_round"); bot1 SetMaxHealth(1000); bot2 SetMaxHealth(1000); bot3 SetMaxHealth(1000); bot1 thread b1goal(); wait(3); bot2 thread b2goal(); wait(3); bot3 thread b3goal(); level waittill("end_of_round"); } } function b1goal() { level endon( "game_ended" ); self endon( "end_of_round" ); player = thread mplayer(); while(1) { if(isdefined(player.revivetrigger)) { self BotSetGoal(player.origin,1); player.revivetrigger waitTill("trigger"); player StartRevive(self); wait(2); player zm_laststand::revive_success(self); player StopRevive(self); player AllowJump(true); wait(.05); } if(isAlive(player)&&!isdefined(player.revivetrigger)) { self BotSetGoal(player.origin+(-72,0,0),72); weap1 = player GetCurrentWeapon(); self giveWeapon(weap1); self switchToWeapon(weap1); } weap2 = self GetCurrentWeapon(); self giveMaxAmmo(weap2); wait(9); } } function b2goal() { level endon( "game_ended" ); self endon( "end_of_round" ); player = thread mplayer(); while(1) { if(isdefined(player.revivetrigger)) { self BotSetGoal(player.origin,1); player.revivetrigger waitTill("trigger"); player StartRevive(self); wait(2); player zm_laststand::revive_success(self); player StopRevive(self); player AllowJump(true); wait(.05); } if(isAlive(player)&&!isdefined(player.revivetrigger)) { self BotSetGoal(player.origin+(0,72,0),72); weap1 = player GetCurrentWeapon(); self giveWeapon(weap1); self switchToWeapon(weap1); } weap2 = self GetCurrentWeapon(); self giveMaxAmmo(weap2); wait(9); } } function b3goal() { level endon( "game_ended" ); self endon( "end_of_round" ); player = thread mplayer(); while(1) { if(isdefined(player.revivetrigger)) { self BotSetGoal(player.origin,1); player.revivetrigger waitTill("trigger"); player StartRevive(self); wait(2); player zm_laststand::revive_success(self); player StopRevive(self); player AllowJump(true); wait(.05); } if(isAlive(player)&&!isdefined(player.revivetrigger)) { self BotSetGoal(player.origin+(72,0,0),72); weap1 = player GetCurrentWeapon(); self giveWeapon(weap1); self switchToWeapon(weap1); } weap2 = self GetCurrentWeapon(); self giveMaxAmmo(weap2); wait(9); } } function mplayer() { level endon( "game_ended" ); mhost = 0; playersall = GetPlayers(); foreach(player in playersall) { if(player isHost()) { mhost = player; } } return mhost; }
Morpex 10 Mar, 2020 @ 1:42pm 
what is a code?
WarpSpider  [developer] 10 Mar, 2020 @ 2:51pm 
It's called gsc language, files are *.gsc
Haken Studios 22 May, 2020 @ 5:13pm 
So I downloaded the latest version of those .gsc files how would I change the health and restrict auto revive? Also how would I change the actual coding for the mod myself??
WarpSpider  [developer] 22 May, 2020 @ 6:20pm 
It can take a long time to learn how to use gsc language, depending on how much you already know about writing computer code. It is similar to Java and C,C++, C# languages.
But commenting out these lines should do it: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2105757590
Last edited by WarpSpider; 22 May, 2020 @ 6:43pm
killerkoffe 1 Feb, 2021 @ 8:16am 
Hey, thanks for posting your source code I was able to learn a bunch from it. I have been able to get the bot to run around and avoid zombies and even train them. I also have been able to get the bot to buy weapons off the wall. So far I have been editing the gsc file for the zm_test map, since it is quick to load, it helps with the debugging process. At this point I want to test it on larger maps since it is working well. Something I have been having trouble with is creating a mod with script files from the workshop tools. When I create a zm_mode map, a script folder is automatically generated, but when I create a new mod, there is no script folder generated. I looked at your source files and I was able to determine that in the zone_source folder in zm_mod.zone there were additional lines:

scriptparsetree,scripts/zm/teamBots.gsc
scriptparsetree,scripts/zm/_zm_ffotd.gsc

which were for your script files, which makes sense. I added the same lines except with the names of my gsc files, except that when I link and build the mod It doesn't load my functions when I am in a map. I copied the same format you used by creating a main_start() function and threading my own function inside.

Is there something else I need to do in order to get the scripts to work in a mod?
I tried looking up this issue online but I wasn't able to find a solution, I'm a little stuck right now, if you were able to help me out now that would mean a lot.

also, would you be interested in working together on either of your zombies mode team bot mods?
WarpSpider  [developer] 1 Feb, 2021 @ 5:37pm 
You probably need to add the _zm_ffotd.gsc to your mod folder. This is a standard file that you can override with your own, edited copy of it. That's how you can inject functions from your own scripts. It's not the only file that you can use as an override, but's it's the one i like to use...some ppl use _load.gsc or even _zm_perk_quick_revive.gsc
You can find these scripts in the Bo3 folder share/raw/scripts/zm, but don't edit those, make copies and put in your mod's folder with the same path where the raw folder would equal the root.
I can help out every now and then, if you want to add me, that's fine but i don't really work on mods anymore.
killerkoffe 1 Feb, 2021 @ 7:58pm 
Thank you so much! that was it! Even if you're not working on mods anymore, would it still be ok for me to credit you in the description if I release the bot mod I am working on to the workshop? Thanks again, I was really stuck at that step for awhile.
< >
Showing 1-15 of 16 comments
Per page: 1530 50