Game Development Community

AI shapeFile.

by Alfred CLUMSON · in Technical Issues · 02/02/2005 (10:03 pm) · 3 replies

How can I set the shapefile for my AI character to work? I want to use the AiPlayer.cs code to get some Ai works done but I have no idea how to attach a character to it.
Also if somebody have any documentation about Aiclient namespace. I'm quite confused with AI in torque.
Regards.

#1
02/03/2005 (6:49 am)
Check the Code sampler tutorials, they will give you a good idea on how to create a bot a set it to follow a path
#2
02/04/2005 (2:59 pm)
Yes I've used the bot code on codeSampler I think they used the bot character defined by the engine in the code :
function AIManager::spawn( %this )
{
.
.
.
     // Bot_2 has a path to follow, so we'll help him out by having him spawn     
    // by the Path's first Path Marker. Once he spawns, he'll begin to follow
	// the path using the A.I. helper functions defined here in this file.

	%bot = AIPlayer::spawnOnPath( "Bot_2", "MissionGroup/myPath" );
	%bot.followPath( "MissionGroup/myPath", -1 );

   return %bot;
}

but I want to use my own characrters to represent the Bot. ok please take a look at the Aisenses here
my question is how can I put my own character to test that code ?
Thanks .
#3
04/07/2006 (8:17 pm)
Try this

First make three different paths. Make two sims(like folders and put paths in in them )Paths2(), Paths3().
Then attach pathmakers too them.

Save.

In aiplayer.cs. Bottom.
Put this
function AIManager::spawn(%this)
{
   %player = AIPlayer::spawnOnPath("Posh","MissionGroup/Paths/Path1");
   %player.followPath("MissionGroup/Paths/Path1",-1);
   
      %player = AIPlayer::spawnOnPath("Spice","MissionGroup/Paths2/Paths2");
   %player.followPath("MissionGroup/Paths2/Paths2",-1);
   
      %player = AIPlayer::spawnOnPath("Rachel","MissionGroup/Paths3/Paths3");
   %player.followPath("MissionGroup/Paths3/Paths3",-1);

   %player.mountImage(CrossbowImage,0);
   %player.setInventory(CrossbowAmmo,1000);
   return %player;
}