Create an AIPlayer in the World Editor
by Brandon Fogerty · in Torque Game Engine Advanced · 02/12/2010 (2:53 pm) · 2 replies
I want to create an Elf AI bot while in the world editor. When I create one using the world creator, the elf is static and when I play, I can walk right through her. The only way I know how to make the elf an AI player is to manually, in torque script, do
new AIPlayer(elf)
{
datablock = ElfData;
};
I have tried assigning the class name parameter, in the world editor, to AIPlayer however this doesn't change anything. Any ideas? Thanks!
new AIPlayer(elf)
{
datablock = ElfData;
};
I have tried assigning the class name parameter, in the world editor, to AIPlayer however this doesn't change anything. Any ideas? Thanks!
#2
EDIT: Right, and somewhere you need to add a PlayerData::create function. Check out other create functions in the stock scripts for what to do here - basically return a new object of the datablock type used.
02/13/2010 (1:41 pm)
I'm going to have a guess here - I'll go check and report back. Try adding a 'category' member to your datablock, and see if it shows up in the editor where other datablocks are.EDIT: Right, and somewhere you need to add a PlayerData::create function. Check out other create functions in the stock scripts for what to do here - basically return a new object of the datablock type used.
Torque Owner Javier Canon