SeBeQ
04-22-2010, 08:06 AM
Hi everyone!
I created a script based on the forum topic "Creating Custom AI Question" http://forums.epicgames.com/showthread.php?t=718104
I would like to operate a class is not only one bot, and many of the bots.
var Badguy1 MyBadguy1Pawn;
change to
var class<Pawn> MyBadguy1Pawn;
and
function SetPawn(Badguy1 NewPawn)
{
MyBadguy1Pawn = NewPawn;
Possess(MyBadguy1Pawn, false);
MyNavigationPoints = MyBadguy1Pawn.MyNavigationPoints;
}
to
function SetPawn(class<Pawn> NewPawn)
{
MyBadguy1Pawn = NewPawn;
Possess(MyBadguy1Pawn, false);
MyNavigationPoints = MyBadguy1Pawn.MyNavigationPoints;
}
However, this causes confusion:
MyBadguy1Pawn.SetAttacking(false);
C:\UDK\UDK-2010-03\Development\Src\TestGame\Classes\TestEnemyContr oller.uc(82) : Error, Unrecognized member 'SetAttacking' in class 'Class'
another problem is that the function:
var TestEnemyController MyController;
simulated function PostBeginPlay()
{
super.PostBeginPlay();
SetPhysics(PHYS_Walking);
if (MyController == none)
{
MyController = Spawn(class'TestEnemyController', self);
MyController.SetPawn(self);
}
}
Only when I do a class on the basis of whether UTPawn or Pawn and variable swap controller = class'TestEnemyController' bots react properly.
And how to use multiple AIController to many bots?
When I have no change in the controller it comes up with the bot AI deathmatch.
I created a script based on the forum topic "Creating Custom AI Question" http://forums.epicgames.com/showthread.php?t=718104
I would like to operate a class is not only one bot, and many of the bots.
var Badguy1 MyBadguy1Pawn;
change to
var class<Pawn> MyBadguy1Pawn;
and
function SetPawn(Badguy1 NewPawn)
{
MyBadguy1Pawn = NewPawn;
Possess(MyBadguy1Pawn, false);
MyNavigationPoints = MyBadguy1Pawn.MyNavigationPoints;
}
to
function SetPawn(class<Pawn> NewPawn)
{
MyBadguy1Pawn = NewPawn;
Possess(MyBadguy1Pawn, false);
MyNavigationPoints = MyBadguy1Pawn.MyNavigationPoints;
}
However, this causes confusion:
MyBadguy1Pawn.SetAttacking(false);
C:\UDK\UDK-2010-03\Development\Src\TestGame\Classes\TestEnemyContr oller.uc(82) : Error, Unrecognized member 'SetAttacking' in class 'Class'
another problem is that the function:
var TestEnemyController MyController;
simulated function PostBeginPlay()
{
super.PostBeginPlay();
SetPhysics(PHYS_Walking);
if (MyController == none)
{
MyController = Spawn(class'TestEnemyController', self);
MyController.SetPawn(self);
}
}
Only when I do a class on the basis of whether UTPawn or Pawn and variable swap controller = class'TestEnemyController' bots react properly.
And how to use multiple AIController to many bots?
When I have no change in the controller it comes up with the bot AI deathmatch.