AIPlayer function
by Tasty Green Pees :-, · in Torque Game Engine · 02/20/2006 (1:02 am) · 2 replies
I've created an ai driven player from the beginner's tutorial. It work fine however...
I was wondering where, in the bottom peice of code, the AIPlayer object/function/datablock was called from. Or is this AIPlayer function being created right here?
Thank you
I was wondering where, in the bottom peice of code, the AIPlayer object/function/datablock was called from. Or is this AIPlayer function being created right here?
function AIPlayer::spawn( %name, %spawnPoint )
{
// Create the A.I. driven bot object...
%player = new AIPlayer()
{
dataBlock = MyBot;
path = "";
};
MissionCleanup.add( %player );
%player.setShapeName( %name );
%player.setTransform( %spawnPoint );
return %player;
}Thank you
About the author
#2
The explanation really clarified it, thanks.
02/20/2006 (10:38 am)
Yeah that makes sense. I'm kinda a new to this so sometime I need things to be spelled out for me.The explanation really clarified it, thanks.
Torque Owner Stefan Lundmark
You're not very clear.
%player is the object ID which is returned from new AIPlayer(){};.
The datablock is created elsewhere before the function is called.