Game Development Community

Stupid question im sure

by Daniel Brown · in Torque Game Engine · 06/14/2004 (10:07 am) · 4 replies

Hey all,

I was playin around with starter.fps today tryin to get some ai to work, but how do i add another ai object? i cant find the object/shape which i have to add where u can specify datablock and name etc?

thanks for any help sorry if it doesnt make any sense

#1
06/14/2004 (10:44 am)
There are no such things as stupid questions. Forget what famous person said that... Anyway.

All you should have to do is call the AIPlayer's class SpawnPlayer property. For example:

%anewbot = AIPlayer::Spawn("Botname", "Spawnpointname") ;

Go look in AIPlayer.cs for the Spawn code. It will show you exactly how to to create a new AIPlayer instance.
#2
06/14/2004 (11:00 am)
Or
%anewbot = aimanager::spawn();
#3
06/14/2004 (5:50 pm)
Be carefull with AiManager::spawn();

It will spawn a bot on the path, probably at the same place that the other one. So You'll end up with two bots coliding with each other.

As I discovered by myself, spawning other bots require some understanding of how the AIplayer.cs file works. My suggestion would be rewriting the spawnOnPath function so it spawns both bots in different places.
#4
06/15/2004 (5:08 am)
Cool! Thanks guys.