How to work with Bots ?
by Areal Person · in Torque Game Engine · 08/10/2006 (11:33 am) · 0 replies
Ok, I got a script to create two bots like the following.
But How do I work with each individule bot ? What function
do I use ? Whats the varaible scope ? and what variable for each bot ?
Now that there on there own path how do I work with each bot ?
use array ?, How ? to do it ?
Thanks,
function AIManager::think( %this )
{
if( !isObject( %this.player ) )
%this.player = %this.spawn();
%this.schedule( 500, think );
}
function AIManager::spawn( %this )
{
%bot = AIPlayer::spawnOnPath( "Bot_1", "MissionGroup/Path1" );
%bot.followPath( "MissionGroup/Path1", -1 );
%bot = AIPlayer::spawnOnPath( "Bot_2", "MissionGroup/Path2" );
%bot.followPath( "MissionGroup/Path2", -1 );
return %bot;
}
But How do I work with each individule bot ? What function
do I use ? Whats the varaible scope ? and what variable for each bot ?
Now that there on there own path how do I work with each bot ?
use array ?, How ? to do it ?
Thanks,
function AIManager::think( %this )
{
if( !isObject( %this.player ) )
%this.player = %this.spawn();
%this.schedule( 500, think );
}
function AIManager::spawn( %this )
{
%bot = AIPlayer::spawnOnPath( "Bot_1", "MissionGroup/Path1" );
%bot.followPath( "MissionGroup/Path1", -1 );
%bot = AIPlayer::spawnOnPath( "Bot_2", "MissionGroup/Path2" );
%bot.followPath( "MissionGroup/Path2", -1 );
return %bot;
}