Game Development Community

I've broken my thirdperson toggle

by Alan James · in Torque Game Engine · 01/17/2006 (8:52 pm) · 8 replies

Well, I though I'd be able to figure this out but I'm stumped. With my merge of *ALOT* of different stuff into 1.4 with TLK 1.4 I've managed to disable the ability to toggle between first and third person, it now runs only in first person. I've run diffs against working older example directories, I've checked default.binds, configs, prefs, inits, I've compared player.cc files, ran diffs against engine directories looking for something that would stop the "tab togglefirstperson" to stop working. I have a couple particular resouces that might be the culprits, a zoom resource and first person model (a small change in player.cc) but looking at them I haven't been able to see what might be stopping the switch between eye and cam.

The keyboard command appears to be being sent. The reason I believe this is that I can't switch to zoomed mode until I hit the "tab" key a second time...this would indicate to me that the engine believes that I've switched to third person and in doing so disables the zoom.

Any clues would be appreciated, and If any other info would be helpful in helping solve this, just yell and I'll post anything else that might prove useful.

Thanks,
- Alan

#1
01/17/2006 (9:59 pm)
Do you see any errors to the keyboard command in the console?
#2
01/17/2006 (10:11 pm)
Nope Cameron, in fact the console log looks identical to the working builds when I try to switch between 1st and 3rd person. Go figure huh?

It should go:

keyboard0 input device acquired.
keyboard0 input device unacquired.

Right? It works in a 1.3 build but not in 1.4. Not sure what I broke.

- Alan
#3
01/18/2006 (6:04 am)
I know exactly what the problem is, I had the same thing happen to me. The commands for toggling the camera have changed in 1.4. I don't remember the new method off the top of my head, but if you look at a clean copy of 1.4 you'll see it.
#4
01/18/2006 (12:56 pm)
Hey Scott,

If you can remember where that 1st/3rd person toggle is different it would be great. I dropped a clean copy in a new directory and ran a dif against it and for the life of me I can't see where the "togglefirstperson" has changed. I know I'm probably looking right over it but if you or anyone else knows I'd love a heads up.

- Alan
#5
01/18/2006 (1:23 pm)
Ok, I found where it was. Its in default.bind.cs. The new code looks like this:

$firstPerson = true;
function toggleFirstPerson(%val)
{
   if (%val)
   {
      $firstPerson = !$firstPerson;
      ServerConnection.setFirstPerson($firstPerson);
   }
}
#6
01/18/2006 (2:19 pm)
Cool Scott, I think I've seen that but I don't know if previous modifications overwrote it or not. I'll check it out and see if that's it when I get home from work.

- Alan
#7
01/18/2006 (4:22 pm)
Hey Scott, that was where it was at, but with the zoom resource I needed to change it to look like this:

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

I probably should post this in the zoom resource thread too.

- Alan
#8
01/19/2006 (6:07 am)
That's right Alan. Mine looked like that, but I deleted the $ZoomOn check when I posted it since I didn't know if you had the resource or not.