Game Development Community

RenderFirstPerson

by Brandon Fogerty · in Technical Issues · 06/26/2007 (7:18 pm) · 14 replies

Seems renderFirstPerson = false doesn't make my player redner in thrid person. Here is ym player datablock.



datablock PlayerData(PlayerBody)
{
cameraMaxDist = 3;
runForce = 200;
jumpDelay = 2;
jumpForce = 300;
gravity = -1000;
mass = 0.5;
density = 0.5;
boundingBox = "1.0 1.0 2.2";
shapeFile = "~/data/shapes/player/player.dts";
renderFirstPerson = true;
groundImpactShakeDuration = 0.001;
};


Anything wrong with ym syntax?

#1
06/26/2007 (7:21 pm)
Sorry I meant to change renderFirstPerson = true; to renderFirstPerson = false;

However, even when I do renderFirstPerson = false;

My player is still not rendered in the third person perspective.

Any ideas?
#2
06/26/2007 (8:29 pm)
RenderFirstPerson determines whether you will see your own player model from a first person perspective. Its not an on / off switch for first person to third person. You will still be in first person you just won't see the player body when you turn it off.

If you are testing with starter.fps you can hit tab to switch between first and third person. starter.fps implements this with a function called "toggleFirstPerson".
#3
06/26/2007 (9:40 pm)
Right but I want to start off in third person. I tried putting the

I tried inserting the following code in my player.cs file.

//----------------------------------------------------------------------------
// PlayerBody Datablock methods
//----------------------------------------------------------------------------

function PlayerBody::onAdd(%this,%obj)
{
// Called when the PlayerData datablock is first 'read' by the engine (executable)
$firstPerson = false;
toggleFirstPerson();
}

However that still doesn't work.
#4
06/27/2007 (5:22 am)
Enter "ServerConnection.setFirstPerson(false);" as the last line of code in
GameConnection::onClientEnterGame in the server game.cs. You can still use the tab key to switch.
#5
06/27/2007 (3:12 pm)
Hey thanks Fucifer! That did it!
#6
06/27/2007 (7:00 pm)
You Welcome!
#7
06/27/2007 (9:03 pm)
Hey, Fucifer. Can you tell me where you learned that from? I don't seem to understand where everyone learns these commands? I have gone through the Developer Network and what not, but the documentation for the Torque engine is not very good at all.
#8
06/28/2007 (5:14 am)
I came accross it in the form, I am not sure where. What I do I look at the form almost everyday. I see a new question I don know the answer I keep eye on the thread. When it get answer I will test it out to see if it work. Then I put the question and answer in question data bank. That way I can refer back to it anytime. I am thinking about turn into a book or guide but I am not sure. I have alot of questions and answers. I also have the most common resource in there to. Most of all it is time I have with the engine, I have learn alot from the community.
#9
06/28/2007 (6:17 am)
@Brandon
Quote: I don't seem to understand where everyone learns these commands?

The docs are a little hard to learn, and sometimes hard to even dig up. I reccomend getting the book:

The Game Programmer's Guide to Torque
#10
06/28/2007 (7:11 am)
Brandon - How to force 1st person/3rd person etc is a section in the book that mb mentioned, also you could have a look at the 3d Game programming all in one, failing that searching around the forums, reading resources, tdn, tutorials on here and just good old plain trial and error is how I've picked up most stuff.
#11
06/28/2007 (11:01 am)
.
#12
06/28/2007 (4:09 pm)
Beserk, thanks but I tried that and it didn't work.

mb, Andy, thanks a lot. However I have heard that those books are really bad an a waste of money.
I have heard on the forums that the documentation is old and most of the examples no longer work. Is that the case? Which book is the best for me to invest in? Thanks in advance!
#13
06/28/2007 (6:14 pm)
Brandon - I wouldn't say they're a bad waste of money at all, I've got both books and they both have their uses, in summary I'd say:

3d Game Programming all in one - is an all round book and steps through all of the steps to creating a game including using 3d modelling, textures, constructor, sound, torquescript, etc so is a good intro to the whole scene but as you can imagine with all those topics in one book it doesn't go into huge depths for things. Make sure to get a second edition copy as it was updated to cover tge 1.4 and constructor.

Game Programmers guide to Torque - is purely a torque book (script and ingame editors) any art, sound, 3d model required to build the game in the book is provided on cd and copied to your game folder. There is a lot of good torquescript reference in the book but I found it was let down by having a rubbish index and contents pages so finding anything quickly is a pain.

So which book would really depend on what you're after.

A lot of examples in the forums were written for previous versions of torque yes that's true, but all of the popular ones I've seen include updates to get them working in 1.5 too
#14
06/29/2007 (8:56 am)
.