Hello,
Im trying to spawn my own custom bot with its own custom (dum) AI and custom Pawn. I created my own game type which I extended off xDeathmatch. I've gone through this tutorial over at UnrealWiki.
http://wiki.beyondunreal.com/wiki/Spawning_Your_Own_Bot
However I can't seem to be able to spawn a bot with my customer controller and pawn. The closest I can get it changing my defult controller and pawn to be my custom controller and pawn.
My code is as follows:-
Im just trying to spawn a bot with my customer AI Controller, and down the track I wish to be able to change the bots' character model and play around with the AI - but at this stage I can't even get the basic bot running around.
Can anyone shed some light on this or point me in the right direction - any help would be sweet
Im trying to spawn my own custom bot with its own custom (dum) AI and custom Pawn. I created my own game type which I extended off xDeathmatch. I've gone through this tutorial over at UnrealWiki.
http://wiki.beyondunreal.com/wiki/Spawning_Your_Own_Bot
However I can't seem to be able to spawn a bot with my customer controller and pawn. The closest I can get it changing my defult controller and pawn to be my custom controller and pawn.
My code is as follows:-
Code:
///////////////////////////////////////////// //Main Game Class ///////////////////////////////////////////// class ctc extends xDeathMatch; defaultproperties { GameName="MyMod" Acronym="CtC" MapPrefix="DM" Description="Insert Desc here" } function Bot SpawnBot(optional string botName) { local Bot NewBot; local RosterEntry Chosen; local UnrealTeamInfo BotTeam; BotTeam = GetBotTeam(); Chosen = BotTeam.ChooseBotClass(botName); if (Chosen.PawnClass == None) Chosen.Init(); NewBot = Bot(Spawn(Chosen.PawnClass.default.ControllerClass)); if ( NewBot != None ) NewBot.PawnClass = class'ctc.NewPawn'; InitializeBot(NewBot,BotTeam,Chosen); return NewBot; } ///////////////////////////////////////////// //My new Pawn ///////////////////////////////////////////// class NewPawn extends xPawn; //used to just show that the class has been initalized event PostBeginPlay() { Super.PostBeginPlay(); Log("Pawns begin Play"); } //assign our controller class through the default properties defaultproperties { ControllerClass=class'ctc.MyAIController'; } ///////////////////////////////////////////// //My AI Controller ///////////////////////////////////////////// class MyAIController extends xBot; function SetPawnClass(string inClass, string inCharacter) { Super.SetPawnClass("ctc.NewPawn", inCharacter); } function SetAttractionState() { if ( Enemy != None ) GotoState('FallBack'); else { //want to change this to whatever your default state is you //want for your bot. GotoState('Roaming'); }//close if log("Attraction State Changed to " ); } defaultproperties { PawnClass=class'ctc.NewPawn' }
Can anyone shed some light on this or point me in the right direction - any help would be sweet

Comment