Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

AI Fire Weapon from Unrealscript

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

  • AI Fire Weapon from Unrealscript

    Hey I was just wondering if anybody has working code to make the AI shoot at the player through Unrealscript?

    Right now I am extending from AIController for my AI and UTPawn for my custom bot.

  • #2
    extend from gameAIController, use pawn.botFire(true). DONE!!
    FYI, true is a boolean, if you want them to stop, use false instead of true.

    Comment


    • #3
      Thanks for replying to my question twice Kinos in both threads haha I really want my bots to just shoot at me. I'll give your method a try.

      Comment


      • #4
        The custom Pawn is still not firing Kinos... Heres my AI Controller class.

        class MyAIController extends gameAIController;

        ...farther down in class Guard variable is just an instance of my custom bot class.
        //Where the bot attacks player...
        state Attack
        {
        Begin:
        Pawn.Acceleration = vect(0,0,0);
        Guard.SetAttacking(true);


        while(true && thePlayer.Health > 0)
        {
        Worldinfo.Game.Broadcast(self, "Attacking Player");
        distanceToPlayer = VSize(thePlayer.Location - Pawn.Location);

        //Move to player again out of shooting range distance
        //Don't worry about the commenting below it's just failed attempts
        //to get the bot to shoot the player
        //Out of range to shoot player
        if (distanceToPlayer > attackDistance)
        {
        Worldinfo.Game.Broadcast(self, "Stopped firing");
        Guard.SetAttacking(false);
        Pawn.BotFire(false);
        GotoState('Chaseplayer');
        break;
        }
        //Within range to shoot player
        else
        {
        Worldinfo.Game.Broadcast(self, "firing");
        Pawn.BotFire(true);
        }
        Sleep(1);
        }
        //Done attacking or player is dead
        Guard.SetAttacking(false);

        }

        Comment


        • #5
          Still can't manage to get bots to fire any help?

          Comment

          Working...
          X