Announcement

Collapse
No announcement yet.

Spawn a single bot using a specific AIcontroller

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Spawn a single bot using a specific AIcontroller

    Ok, I'm working on creating a new subclass of AIcontroller and want to be able to spawn only a single bot using that controller. I've figured out that the AIcontroller class is attached to an actor (pawn) but I cant figure out how exactly the bots get spawned into a map and have their aicontroller attached.

    Of course I could just make a mutator to go through all pawns and swap the AIcontroller they are using for my new one, or possibly even just modify the first bot I come across, but that way is going to make it very hard for me to know which bot is using my controller? Plus its always better to have a deeper understanding of how these things happen.

    So my general question is how does a bot pawn get spawned and get a controller attached to it? Is this in the .uc scripts somewhere or is it done natively by a dll or something?

    For example I would like to be able to just spawn a bot named "JimmyTheBot" which uses my modified aicontroller whilst playing the game. Maybe like "addbots 1 jimmythebot" in the console.

    Thanks for any help that you can provide.

    #2
    Does nobody know the answer to this question? *bUmP!*

    Comment


      #3
      I tried spawning bots using summon xGame.xBot and summon UnrealGame.Bot, but no luck.

      You can however, make rather amusing spawn binds such as set input G summon onslaught.onsrocketprojectile for a portable rapid-fire bazooka.

      Do you have the UScript source? If so, search it for "spawn(bot" and you might dig something up. You'll need some trickery to search it in Windows Explorer, though. Search UDN for that. I got it to work once, but somehow lost it and don't seem to be able to install it anymore without messing up something else (**** WinXP...).

      Comment


        #4
        Im part of the way there, I have found that in the Deathmatch.uc file there were the addbots functions and spawnbots etc. This also links to the rosterentry.uc

        What seems to happen is that a xgame.xpawn is spawned and initialised then the "default" controller is possessed which is xgame.xbot.

        Its funny if you summon xgame.xpawn ... you get little decoy jacobs

        If I start extending deathmatch.uc to override the spawnbots function am I going to need to start using a different gametype or something? How would I use the subclass of deathmatch?

        Comment


          #5
          if you extend..

          class YOURGAMEType extends xDeathmatch;

          and write your addbot method with the same parameters, then only it will be replaced. I suggest you look at the startmatch function too...

          class YOURGAMEType extends xDeathmatch;
          function bool AddPed(optional string botName)
          {
          log("Adding bots");
          your code
          }
          function StartMatch()
          {
          log("START SIM (you are in the EvacSimType)");
          your code
          }

          defaultproperties
          {
          i = 0
          PlayerControllerClassName="YOUR AICONTROLLER"
          DefaultPlayerClassName="YOUR PAWN"
          MaxPlayers=50
          myInitialBots = 3
          GameName="GAMETYPE NAME"
          Description="DESCRIPTION"
          }

          there are plenty of other defaults, check them out
          if you dont write any other functions they are inherited through it parents class... basic OOP.

          Comment


            #6
            Im already a fairly good programmer in a number of languages including ada, c, c++ and java, and fully understand OOP.

            But thank you for trying to help, its greatly appreciated.

            Anyways, i've got some ideas of how im going to proceed. Thanks everyone.

            Comment


              #7
              my bad.. good luck

              Comment


                #8
                thanks buddy

                Comment

                Working...
                X