Game Development Community

Question relating to 3rd and 1st person views and weapons

by Mike Stoddart · in Torque Game Engine · 08/02/2002 (1:21 pm) · 4 replies

I know this is probably a very simple question, but why do weapons move with the player model in the 3rd person view (i.e. when viewing someone else or when using the F8 key), but not in the 1st person view?

For example, when I fire in the 3rd person view, there is some kickback and the player's weapon clearly moves. However, in the 1st person view the weapon (and sight) remains stationery.

How much work would it take to change this?

Thanks

#1
08/02/2002 (1:28 pm)
datablock ShapeBaseImageData(RifleImage)
{
   // Basic Item properties
   shapeFile = "~/data/shapes/rifle/weapon.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = "0.1 0.2 -0.55";
...etc

Change the eyeOffset to "0 0 0"; and see what happens.
I know this is explained better in another post somewhere, but basically that offset is just to make the weapon appear on the screen in a better position. When it's set to 0 the weapon stays where it really is on the model. In the case of the default blue guy the weapon is down by his waste and sometimes (depending on the weapon) it can't be seen on the screen. It will do the recoil and move with the model though. I plan on making the model hold the weapons up higher so they'll appear on the screen better.
#2
08/02/2002 (1:30 pm)
Thanks a lot. I'll try that out.
#3
08/02/2002 (1:38 pm)
Thanks - I prefer the effect of seeing the weapon move, but as you say, the weapon can disappear off the screen when it's carried at waist level. At least it has more realistic potential this way.

With the crossbow, the idle animation points the weapon to the player's side, so although the muzzle is point at about 20 degrees to the right of the player's line of sight, the projectile still gets fired straight ahead! Of course this could be changed with an updated model.

Thanks again.
#4
08/02/2002 (1:44 pm)
Yep, that's kinda the drawback there :)
I like the effect better too, but that firing straight when the weapon is angled is rather dumb. I can't remember if this did anything:
// When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off.  
   correctMuzzleVector = true; // false for non-corrected view

I know I tried setting that to false, but don't remember if it worked how I wanted. I haven't been doing much with the weapon scripts lately. I should start again.

edit:
Now that I think about it I think it's for whether the projectile starts from the actual muzzlePoint or from the players head/los. Think I've killed too many brain cells :(