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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Removing bots perks and guns to replace them with our choice in mp

Removing bots perks and guns to replace them with our choice in mp

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
4 Posts 2 Posters 122 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • zFastundefined Offline
    zFastundefined Offline
    zFast
    wrote on last edited by
    #1

    Here is my attempt at removing bots perks and guns to give them custom loadout, but it seems that "bot" isn't a defined entity like "player" is

    Does a bot connects to the game? How do you modify its behaviour?

    #include maps\mp\bots\_bot;
    #include maps\mp\bots\_bot_combat;
    
    main() {
        onbotconnect();
    }
    
    onbotconnect(){
       
    	for ( ;; ){
    	   
    	level waittill( "connected", bot );
        bot thread onbotspawned();
        
        
    	   }
    }
    
    onbotspawned()
    {
    	level endon( "game_ended" );
        self endon( "disconnect" );
    	
    	for(;;)
    	{
    		self waittill( "spawned_bot" );
             
          self thread gunsandperksremoval();
          self thread runAndMoveFromSpotstoSpots();
          
          
          wait 0.05;
    	}
    }
    
    gunsandperksremoval() {
    
        self takeallweapons();
        self clearperks();
        self giveweapon("insas_mp+stalker+fastads", 0);
        self setperk( "specialty_unlimitedsprint" );
    }
    
    1 Reply Last reply
    0
    • Sorexundefined Offline
      Sorexundefined Offline
      Sorex Contributor
      wrote on last edited by Sorex
      #2

      zFast
      The "bot" is "player", when you spawn a bot the bot get connected (so in the level waittill( "connected",player) the player can be a bot).

      Call a method onbotconnect do not change how the game behave. The bot spawn and act like a normal player.

      There is no such a thing as "spawn_bot" but there is "spawn_player". You can use that and check if its a bot by looking and the variable pers["isBot"]

      Like this

      onbotconnect(){
         
      	for ( ;; )
              {  
      	        level waittill( "connected", player);
                      if(isDefined(player.pers["isBot"]) && player.pers["isBot"])
                      {
                              player thread onbotspawned();
                      }
          
              }
      }
      
      zFastundefined 1 Reply Last reply
      0
      • zFastundefined Offline
        zFastundefined Offline
        zFast
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • zFastundefined Offline
          zFastundefined Offline
          zFast
          replied to Sorex on last edited by zFast
          #4

          Sorex hmm okay so far this is what I've got

          onplayerconnect(){
             
          	for ( ;; ){
          	   
          	level waittill( "connected", player );
              player thread unlimitedAmmo();
              player thread onplayerspawned();
              player thread input();
              if(isDefined(player.pers["isBot"]) && player.pers["isBot"])
                          {
                                  player thread onbotspawned();
                          }
              
          	   }
          }
          
          onbotspawned()
          {
          	level endon( "game_ended" );
              self endon( "disconnect" );
          	
          	for(;;)
          	{
          		self waittill( "spawned_player" );
                   
                  self thread gunsandperksremoval();
                
                
                
                wait 0.05;
          	}
          }
          
          gunsandperksremoval() {
          
              self takeallweapons();
              self clearperks();
              self giveweapon("insas_mp+stalker+fastads", 0);
              self setperk( "specialty_unlimitedsprint" );
          }
          

          It took the weapon and perks for sure, and it gave unlimited sprints to bots but it didnt give an msmc

          1 Reply Last reply
          0

          • Login

          • Don't have an account? Register

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