Game Development Community

Add aiplayer in tgea

by Ironbelly Studios · in Torque Game Engine Advanced · 10/18/2008 (6:47 am) · 4 replies

Hello all,

I want to add aiplayer in my tgea 1.7.1 projects.I am newly in tgea before i was working on tge1.4.How will i accomplished this problem.After copy of aiplayer.cs file , i put it into my projects and i added the " exec("./aiplayer.cs") " in game.cs file.Again i wrote


new ScriptObject(AIManager) {};
MissionCleanup.add(AIManager);
AIManager.think();

this in game.cs, but my aiplayer is not present in my game.Thanx in advance.

#1
10/18/2008 (6:56 am)
Make sure that // aiplayer.cs is not commented out or is defined in the game.cs file under script execution function onServerCreated()
#2
10/18/2008 (7:01 am)
Also if you are using the T3D build, then it may not have aiPlayer.cs in the ScriptsAndAssets foldier under server/scripts, copy and paste the aiplayer.cs script from the TGEADemoAdvanced build if this is the case.
#3
10/18/2008 (7:36 am)
Yes i have added aiplayer.cs file from TGEADemoAdavanced.But i got the aimanager think() function is not written into aiplayer.cs file, then how thw aiplayer will be created.When i am writtine this code

new ScriptObject(AIManager) {};
MissionCleanup.add(AIManager);
AIManager.think();

from game.cs file.
#4
10/18/2008 (11:38 am)
%bot = new AIPlayer(Enemy001) {datablock = ........; AIPlayer = true;};