Game Development Community

How do I force 3rd person view?

by Nicolai Dutka · in Torque Game Engine · 09/02/2007 (11:44 pm) · 3 replies

As the topic title suggests, I want the player to start out the mission in 3rd person view and not allow switching to first person. How would I do this?

#1
09/03/2007 (1:44 am)
The best place to change it is in code. The Firstperson variable is set to true, by default. Since you're posting in the Public Area I take it you dont have a license (and dont have the code to just change)

So in function GameConnection::onClientEnterGame(%this) add this:
%this.setFirstPerson(false);

You might want to check out client/scripts/default.bind.cs and change this:
$firstperson = false;

$firstperson is only used to keep track (since TGE 1.4 I think)
#2
09/03/2007 (1:49 am)
To make sure they users dont switch back, remove:

$firstPerson = true;
function toggleFirstPerson(%val)
{
   if (%val)
   {
      $firstPerson = !$firstPerson;
      ServerConnection.setFirstPerson($firstPerson);
   }
}

and

moveMap.bind(keyboard, tab, toggleFirstPerson );


I dont think it's possible to remove Firstperson totally without code changes though, without removing the console.

A player can just type ServerConnection.setFirstPerson(true); into the console.
#3
09/03/2007 (6:26 am)
I posted in public because it said if this is something that the public could benefit from seeing, it should go here. I have an Indie License with the 1.5.2 SDK of TGE.


I added

%this.setFirstPerson(false);

to my game.cs where you said to and it works like a charm.

I commented out the

//moveMap.bind(keyboard, tab, toggleFirstPerson );

in my default.bind.cs just in case I want to use it later