Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] Bots in Zombies

[Support] Bots in Zombies

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
16 Posts 15 Posters 4.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AndreasOmeirundefined AndreasOmeir

    Is there any way for bots to be added in zombies? Playing offline zombies gets kinda lonely.

    JezuzLizardundefined Offline
    JezuzLizardundefined Offline
    JezuzLizard
    Plutonium Staff
    wrote on last edited by
    #4

    AndreasOmeir I have a bot script that lets you spawn in bots in zombies. They have no AI so all they do is stand around doing nothing but maybe you can port over the mp bot script. For some reason they will instantly bleed out on MoTD, but all other maps work.

    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies\_zm;
    #include maps\mp\zombies\_zm_utility;
    
    
    init()
    {
        level.bots_to_add = 1; //change this to add up to 7 bots to the game
        SetDvar( "scr_zm_enable_bots", "1" );
        level thread onPlayerConnect();
        thread add_bots();
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
        }
    }
    
    onPlayerSpawned()
    {
        self endon("disconnect");
        level endon("game_ended");
        for(;;)
        {
            self waittill("spawned_player");
        }
    }
    
    add_bots()
    {
        setdvar( "bot_AllowMovement", "1" );
        setdvar( "bot_PressAttackBtn", "1" );
        setdvar( "bot_PressMeleeBtn", "1" );
        num_bots = 0;
        wait 20;
        while ( num_bots < level.bots_to_add )
        {
       		wait 1;
        	zbot_spawn();
        	level.numberbotsadded++;
        	num_bots++;
        }
        players = get_players();
        i = 0;
        while ( i < players.size )
        {
            players[ i ] freezecontrols( 0 );
            i++;
        }
        while ( players.size < 2 )
    	{
    		wait 1;
    		players = get_players();
    	}
        flag_set( "start_zombie_round_logic" );
    }
    
    zbot_spawn()
    {
        spawnpoints = getstructarray( "initial_spawn_points", "targetname" );
        spawnpoint = getfreespawnpoint( spawnpoints );
        bot = addtestclient();
        if ( !isDefined( bot ) )
        {
            return;
        }
        bot.pers[ "isBot" ] = 1;
        bot.equipment_enabled = 0;
        yaw = spawnpoint.angles[ 1 ];
        bot thread zbot_spawn_think( spawnpoint.origin, yaw );
        return bot;
    }
    
    zbot_spawn_think( origin, yaw )
    {
        self endon( "disconnect" );
        for ( ;; )
        {
            self waittill( "spawned_player" );
            //self setorigin( (2170.5, 4660.37, -299.875) ); // change to set their spawn location
            //angles = ( 0, yaw, 0 );
            //self setplayerangles( angles );
        }
    }
    

    I guess this could also be used to test things since they functionally simulate an actual player joining/spawning.

    ImGodatDisundefined 1 Reply Last reply
    0
    • H3X1Cundefined Offline
      H3X1Cundefined Offline
      H3X1C
      Plutonium Staff
      wrote on last edited by
      #5

      Technically they can be spawned in but they have no ai so are useless.

      1 Reply Last reply
      0
      • FNAFBOYGAMINGundefined Offline
        FNAFBOYGAMINGundefined Offline
        FNAFBOYGAMING
        wrote on last edited by
        #6

        How do i apply this script

        1 Reply Last reply
        1
        • FragsAreUsundefined Offline
          FragsAreUsundefined Offline
          FragsAreUs
          Plutonium Staff
          wrote on last edited by
          #7

          there is no need to even use this script because of the fact there is no ai movment made for it so they wont do anything

          1 Reply Last reply
          0
          • FNAFBOYGAMINGundefined Offline
            FNAFBOYGAMINGundefined Offline
            FNAFBOYGAMING
            wrote on last edited by FNAFBOYGAMING
            #8

            I dont care about them not moving i asked how can i get this mod not *"DoEs tHeSe bOts mOvE?" I just wanna know how to apply bots in zombies for testing perposes etc. Thank you in advance

            SnakeLegendaryundefined 1 Reply Last reply
            0
            • AndreasOmeirundefined AndreasOmeir

              Is there any way for bots to be added in zombies? Playing offline zombies gets kinda lonely.

              yagobarreyundefined Offline
              yagobarreyundefined Offline
              yagobarrey
              wrote on last edited by
              #9

              AndreasOmeir lets pay together

              1 Reply Last reply
              0
              • FNAFBOYGAMINGundefined FNAFBOYGAMING

                I dont care about them not moving i asked how can i get this mod not *"DoEs tHeSe bOts mOvE?" I just wanna know how to apply bots in zombies for testing perposes etc. Thank you in advance

                SnakeLegendaryundefined Offline
                SnakeLegendaryundefined Offline
                SnakeLegendary
                Contributor
                wrote on last edited by
                #10

                FNAFBOYGAMING Have you found a way yet to apply the script? I would love to use this script.

                Dopemp3undefined 1 Reply Last reply
                0
                • SnakeLegendaryundefined SnakeLegendary

                  FNAFBOYGAMING Have you found a way yet to apply the script? I would love to use this script.

                  Dopemp3undefined Offline
                  Dopemp3undefined Offline
                  Dopemp3
                  wrote on last edited by Dopemp3
                  #11

                  SnakeLegendary I would assume you just add this script to your "_clientids.gsc" file, and you should be good to go!

                  Aoteruzundefined 1 Reply Last reply
                  0
                  • Acrillxundefined Offline
                    Acrillxundefined Offline
                    Acrillx
                    wrote on last edited by Acrillx
                    #12

                    just find a way to get this script and then edit the code or base your own bot script of this but with map knowledge and of course the ability to move and stuff then boom you have a bot script with decent bots that move!!

                    1 Reply Last reply
                    0
                    • Dopemp3undefined Dopemp3

                      SnakeLegendary I would assume you just add this script to your "_clientids.gsc" file, and you should be good to go!

                      Aoteruzundefined Offline
                      Aoteruzundefined Offline
                      Aoteruz
                      wrote on last edited by
                      #13

                      Dopemp3 I'm pretty stupid when it comes to adding scripts to stuff so can you tell me a specific way to do that? Do I just create a new line and then paste?

                      Resxtundefined 1 Reply Last reply
                      0
                      • Aoteruzundefined Aoteruz

                        Dopemp3 I'm pretty stupid when it comes to adding scripts to stuff so can you tell me a specific way to do that? Do I just create a new line and then paste?

                        Resxtundefined Offline
                        Resxtundefined Offline
                        Resxt
                        Plutonium Staff
                        wrote on last edited by
                        #14

                        @Avengeful_Gaming https://forum.plutonium.pw/topic/16893/alpha-zombies-bo2-zombies-bots/

                        1 Reply Last reply
                        0
                        • JezuzLizardundefined JezuzLizard

                          AndreasOmeir I have a bot script that lets you spawn in bots in zombies. They have no AI so all they do is stand around doing nothing but maybe you can port over the mp bot script. For some reason they will instantly bleed out on MoTD, but all other maps work.

                          #include maps\mp\_utility;
                          #include common_scripts\utility;
                          #include maps\mp\zombies\_zm;
                          #include maps\mp\zombies\_zm_utility;
                          
                          
                          init()
                          {
                              level.bots_to_add = 1; //change this to add up to 7 bots to the game
                              SetDvar( "scr_zm_enable_bots", "1" );
                              level thread onPlayerConnect();
                              thread add_bots();
                          }
                          
                          onPlayerConnect()
                          {
                              for(;;)
                              {
                                  level waittill("connected", player);
                                  player thread onPlayerSpawned();
                              }
                          }
                          
                          onPlayerSpawned()
                          {
                              self endon("disconnect");
                              level endon("game_ended");
                              for(;;)
                              {
                                  self waittill("spawned_player");
                              }
                          }
                          
                          add_bots()
                          {
                              setdvar( "bot_AllowMovement", "1" );
                              setdvar( "bot_PressAttackBtn", "1" );
                              setdvar( "bot_PressMeleeBtn", "1" );
                              num_bots = 0;
                              wait 20;
                              while ( num_bots < level.bots_to_add )
                              {
                             		wait 1;
                              	zbot_spawn();
                              	level.numberbotsadded++;
                              	num_bots++;
                              }
                              players = get_players();
                              i = 0;
                              while ( i < players.size )
                              {
                                  players[ i ] freezecontrols( 0 );
                                  i++;
                              }
                              while ( players.size < 2 )
                          	{
                          		wait 1;
                          		players = get_players();
                          	}
                              flag_set( "start_zombie_round_logic" );
                          }
                          
                          zbot_spawn()
                          {
                              spawnpoints = getstructarray( "initial_spawn_points", "targetname" );
                              spawnpoint = getfreespawnpoint( spawnpoints );
                              bot = addtestclient();
                              if ( !isDefined( bot ) )
                              {
                                  return;
                              }
                              bot.pers[ "isBot" ] = 1;
                              bot.equipment_enabled = 0;
                              yaw = spawnpoint.angles[ 1 ];
                              bot thread zbot_spawn_think( spawnpoint.origin, yaw );
                              return bot;
                          }
                          
                          zbot_spawn_think( origin, yaw )
                          {
                              self endon( "disconnect" );
                              for ( ;; )
                              {
                                  self waittill( "spawned_player" );
                                  //self setorigin( (2170.5, 4660.37, -299.875) ); // change to set their spawn location
                                  //angles = ( 0, yaw, 0 );
                                  //self setplayerangles( angles );
                              }
                          }
                          

                          I guess this could also be used to test things since they functionally simulate an actual player joining/spawning.

                          ImGodatDisundefined Offline
                          ImGodatDisundefined Offline
                          ImGodatDis
                          wrote on last edited by
                          #15

                          JezuzLizard i mean you just need to open up console and write in it spawnBot 3 and same they cant move

                          1 Reply Last reply
                          0
                          • officialCatnapundefined Offline
                            officialCatnapundefined Offline
                            officialCatnap
                            wrote on last edited by
                            #16

                            and model is missing charecter i useing Bots not working

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Donate