Ai Vehicle...
by Lane Anderson · in Torque Game Engine · 03/04/2005 (3:33 pm) · 1 replies
Hey,
I am trying to create a Ai controlled Flying Vehicle. Here are the 2 chunks of code i am trying to modify(from Aiplayer.cs):
function AIPlayer::spawnNrun(%name,%spawnPoint, %dest)
{
// Create the demo player object
%player = new AiPlayer() {
dataBlock = DemoPlayer;
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint);
%player.setMoveDestination(%dest);
return %player;
}
function AIManager::spawn(%this)
{
%player = AIPlayer::spawnNrun("Sub1","499.744 50.0 500", "458.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub2","495.745 50.0 500", "478.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub3","491.345 50.0 500", "498.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub4","486.945 50.0 500", "518.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub5","482.745 50.0 500", "538.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub6","478.746 50.0 500", "558.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub7","474.746 50.0 500", "578.005 128.151 104.925");
return %player;
}
I tried putting a FlyingVehicle datablock I made in "datablock = DemoPlayer" But there were TONS in errors when i opened the console :). Does the problem lie in the fact that Aiplayer derives from the Player datablock, making it impossible to use a different one?
Lane
I am trying to create a Ai controlled Flying Vehicle. Here are the 2 chunks of code i am trying to modify(from Aiplayer.cs):
function AIPlayer::spawnNrun(%name,%spawnPoint, %dest)
{
// Create the demo player object
%player = new AiPlayer() {
dataBlock = DemoPlayer;
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint);
%player.setMoveDestination(%dest);
return %player;
}
function AIManager::spawn(%this)
{
%player = AIPlayer::spawnNrun("Sub1","499.744 50.0 500", "458.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub2","495.745 50.0 500", "478.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub3","491.345 50.0 500", "498.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub4","486.945 50.0 500", "518.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub5","482.745 50.0 500", "538.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub6","478.746 50.0 500", "558.005 128.151 104.925");
%player = AIPlayer::spawnNrun("Sub7","474.746 50.0 500", "578.005 128.151 104.925");
return %player;
}
I tried putting a FlyingVehicle datablock I made in "datablock = DemoPlayer" But there were TONS in errors when i opened the console :). Does the problem lie in the fact that Aiplayer derives from the Player datablock, making it impossible to use a different one?
Lane
About the author
Torque Owner Bruno Grieco
HTH