RTS Tutorial in documentation not working
by Andy S. · in Torque 3D Professional · 12/07/2011 (1:37 am) · 8 replies
Hi,
I tried to follow the RTS tutorial in the docs with 1.2 and it does not owrk properly. When the player spawns, the camera is always in first person mode. Has this tutorial been reviewed and checked against 1.2?
I tried to follow the RTS tutorial in the docs with 1.2 and it does not owrk properly. When the player spawns, the camera is always in first person mode. Has this tutorial been reviewed and checked against 1.2?
#2
12/07/2011 (6:57 am)
thanks richard for the comment. GG needs to fix the tutorial. First impression counts, and as nice as the new fps tut is, the rest of the docs, most importantly the tuts, should be checked if they work before each release.
#3
12/07/2011 (8:56 am)
It's on my list. With 1.1 Final it worked with the template but had this same issue if you rebuilt the project from source. I've been trying to track it down for a while now (as you can see in the blog and forum) but have had little luck. I'll keep plugging away at it though and hopefully I will be able to get the necessary steps into the doc soon.
#4
1.) Add the following function into commands.cs:
function serverCmdorbitCam(%client)
{
%client.camera.setOrbitObject(%client.player, mDegToRad(50) @ " 0 0", 0, 30, 30);
%client.camera.camDist = 1.5;
}
Then, in gamecore/preparePlayer add this:
%game.spawnPlayer(%client, %playerSpawnPoint, false);
commandToServer('orbitCam');//start our custom camera!
Then it will start directly from the orbit cam view and not the fps view. No idea why it works tough...
12/07/2011 (11:36 am)
Richard, I had a look at Steve Acaster's Tactics tutorial. I used his camera code:1.) Add the following function into commands.cs:
function serverCmdorbitCam(%client)
{
%client.camera.setOrbitObject(%client.player, mDegToRad(50) @ " 0 0", 0, 30, 30);
%client.camera.camDist = 1.5;
}
Then, in gamecore/preparePlayer add this:
%game.spawnPlayer(%client, %playerSpawnPoint, false);
commandToServer('orbitCam');//start our custom camera!
Then it will start directly from the orbit cam view and not the fps view. No idea why it works tough...
#5
12/07/2011 (3:19 pm)
Sweet! Good catch. I'll get this updated this week, hopefully.
#6
12/07/2011 (5:15 pm)
Just guessing here, but I remember when the RTS prototype was added to the old T3D repo for testing, someone changed some functionality in the core scripts (which replicated across all projects) that dealt with the camera and spawning which I had to override in the game scripts in order to properly respawn with correct camera and controls... think I made a note of that in the comments somewhere in gameCore.cs. Just guessing that may be the problem though because I haven't looked at the RTS tut since then, and that was over 2 years ago...
#7
12/07/2011 (7:37 pm)
I started thinking that it might have something to do with when the control object is assigned. I'm going to have another look at it (no, really...) and see if I can't get it nailed down.
#8
12/14/2011 (9:59 am)
I discovered that BoomBot has something in its datablock that interferes with this. When I cleared it all out except for the shapeFile property it worked correctly. I plan to go through and find the culprit, but this fixed the problem where the camera sticks in first/third person mode. I'm slowly going through and getting this straightened out - I hope to have it cleaned up in time for Christmas. This year, I mean.
Torque Owner Richard Ranft
Roostertail Games
It isn't helpful except in a potential troubleshooting way, but if you open the editor and switch to free camera mode and then close the editor your camera should then work properly using the toggle bindings given.
I had a thought but haven't tried it yet - perhaps setting the camera to 3rd person before switching to the overhead mode on spawn would do the trick....
Here's the link to the 1.1 Final thread for this topic. In the thread header there's a link to the blog as well.