AI Bot Just Won't Change Datablocks
by Nicholas Walstrom · in Torque Game Engine · 12/29/2008 (6:42 pm) · 1 replies
I'm currently trying to learn about creating bots and such, and for my test I'm having logoitem.cs create a bot with the following code:
function TorqueLogoItem::onAdd(%this,%obj)
{
%bot = new AIPlayer(Bob){
datablock = PlayerBody0;
position = "19.3297 -414.609 0.0231501";
};
};
And in player.cs, I have the following:
datablock PlayerData(PlayerBody)
{
renderFirstPerson = false;
shapeFile = "~/data/shapes/player/player.dts";
};
datablock PlayerData(PlayerBody0)
{
renderFirstPerson = false;
shapeFile = "~/data/shapes/bat/dracbatbound.dts";
};
However, the AI bot still uses PlayerBody instead of PlayerBody0. Why does it do this?! If I change PlayerBody to dracbatbound.dts, the AI bot changes as well, but I don't want my player to be dracbatbound.dts... and I'm going to want to have different types of enemies.
It's calling it as PlayerBody somewhere, but where? I'm not calling aiPlayer.cs as far as I know, but just in case, I changed PlayerBody in there to PlayerBody0 as well. The bot still uses player.dts.
function TorqueLogoItem::onAdd(%this,%obj)
{
%bot = new AIPlayer(Bob){
datablock = PlayerBody0;
position = "19.3297 -414.609 0.0231501";
};
};
And in player.cs, I have the following:
datablock PlayerData(PlayerBody)
{
renderFirstPerson = false;
shapeFile = "~/data/shapes/player/player.dts";
};
datablock PlayerData(PlayerBody0)
{
renderFirstPerson = false;
shapeFile = "~/data/shapes/bat/dracbatbound.dts";
};
However, the AI bot still uses PlayerBody instead of PlayerBody0. Why does it do this?! If I change PlayerBody to dracbatbound.dts, the AI bot changes as well, but I don't want my player to be dracbatbound.dts... and I'm going to want to have different types of enemies.
It's calling it as PlayerBody somewhere, but where? I'm not calling aiPlayer.cs as far as I know, but just in case, I changed PlayerBody in there to PlayerBody0 as well. The bot still uses player.dts.
Torque 3D Owner Peter Simard
Default Studio Name
Try using Torsion to step through your code and double check that the values are correct.