Advanced camera problem
by Steve D · in Torque Game Engine · 03/07/2008 (8:01 am) · 3 replies
Before I posted this I tried everything I could to figure this out and I just don't see how I'm doing anything wrong!
The problem is, either in Afx or stock Torque, when using the advanced camera, it doesn't matter what camera mode, when I spawn 2 or more ai players, the aiplayer that's the control object for the camera appears just fine but the second one is invisible. If I go into world creator the second player is there by object id, I can click on it and get the bounding box but it's still invisible.
It gets better. If I spawn the bots in a low range of coordinates, say 100 100 0, they both spawn just fine!!! It's only when I spawn them 400 400 0 or higher the above problem happens.
Then I found out if I change this line, %this.setCameraObject(%this.advcamera) - to %this.setCameraObject(%player) - then both bots show up just fine however when I move the bot (I'm using the Afx target selection) the camera is really shakey.
Below is the simple script I'm using in the createplayer function. I have wasted hours and hours on this, anyone know what I'm doing wrong? Or if anyone has the advanced camera installed can you please try it and see if you get the same result?
// Create the player object
%player = new aiPlayer() {
dataBlock = PlayerBody;
client = %this;
};
MissionCleanup.add(%player);
// Player setup...
%player.setTransform("1000 1000 0");
%this.setControlObject(%this.advcamera);
// Create the player object
%player = new aiPlayer() {
dataBlock = PlayerBody;
client = %this;
};
MissionCleanup.add(%player);
// Player setup...
%player.setTransform("1000 1010 0");
%this.advCamera.setPlayerObject(%player);
%this.advCamera.setOrbitMode();
%this.advCamera.setFollowTerrainMode(false);
%this.advCamera.setVerticalFreedomMode(false);
%this.setCameraObject(%this.advcamera);
The problem is, either in Afx or stock Torque, when using the advanced camera, it doesn't matter what camera mode, when I spawn 2 or more ai players, the aiplayer that's the control object for the camera appears just fine but the second one is invisible. If I go into world creator the second player is there by object id, I can click on it and get the bounding box but it's still invisible.
It gets better. If I spawn the bots in a low range of coordinates, say 100 100 0, they both spawn just fine!!! It's only when I spawn them 400 400 0 or higher the above problem happens.
Then I found out if I change this line, %this.setCameraObject(%this.advcamera) - to %this.setCameraObject(%player) - then both bots show up just fine however when I move the bot (I'm using the Afx target selection) the camera is really shakey.
Below is the simple script I'm using in the createplayer function. I have wasted hours and hours on this, anyone know what I'm doing wrong? Or if anyone has the advanced camera installed can you please try it and see if you get the same result?
// Create the player object
%player = new aiPlayer() {
dataBlock = PlayerBody;
client = %this;
};
MissionCleanup.add(%player);
// Player setup...
%player.setTransform("1000 1000 0");
%this.setControlObject(%this.advcamera);
// Create the player object
%player = new aiPlayer() {
dataBlock = PlayerBody;
client = %this;
};
MissionCleanup.add(%player);
// Player setup...
%player.setTransform("1000 1010 0");
%this.advCamera.setPlayerObject(%player);
%this.advCamera.setOrbitMode();
%this.advCamera.setFollowTerrainMode(false);
%this.advCamera.setVerticalFreedomMode(false);
%this.setCameraObject(%this.advcamera);
#2
03/07/2008 (10:45 am)
Maybe increase the mission files visibleDistance?
#3
That's it! I never would have figured that out. I thought that setting followed you around, and using the normal camera it does, but apparently when you are using the advanced camera it doesn't, it's X amount of units from x 0 and y 0. The default setting was 500 and that explains why I couldn't get my players to render past 400 or so world units.
Thanks again, I appreciate it very much!
03/07/2008 (11:05 am)
So where were you last night when I still had some hair left!? :)That's it! I never would have figured that out. I thought that setting followed you around, and using the normal camera it does, but apparently when you are using the advanced camera it doesn't, it's X amount of units from x 0 and y 0. The default setting was 500 and that explains why I couldn't get my players to render past 400 or so world units.
Thanks again, I appreciate it very much!
Torque Owner Steve D