View Full Version : 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.
02-22-2011, 01:07 PM
extend from gameAIController, use pawn.botFire(true). DONE!!
FYI, true is a boolean, if you want them to stop, use false instead of true.
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.
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...
Pawn.Acceleration = vect(0,0,0);
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");
//Within range to shoot player
//Done attacking or player is dead
Still can't manage to get bots to fire any help?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.