Third Person Question

Billtcm

Newbie
Joined
Nov 23, 2004
Messages
92
Reaction score
0
Hey guys just started messing around with the code trying to get a third-person view and I'm having a little trouble. I'm using the microsoft visual .net 2003 and I've opened the "in_camera.cpp" in client/source files. I have noticed that when I compile it says with the build that 1 has failed, yet I have managed to get third person view and it even fails when I have not altered the code. Now I've done a few things and have only gotten one small effect, the first thing I did was comment out

Code:
if ( gpGlobals->maxClients > 1 )
	{
		// no thirdperson in multiplayer.
		return;
	}

After that I changed a few values, the values underneath are what I got after a bunch of tries.

Code:
#define CAM_DIST_DELTA 1.0
#define CAM_ANGLE_DELTA 2.5
#define CAM_ANGLE_SPEED 2.5
#define CAM_MIN_DIST 30.0
#define CAM_ANGLE_MOVE .5
#define MAX_ANGLE_DIFF 10.0
#define PITCH_MAX 180.0
#define PITCH_MIN 0
#define YAW_MAX  180.0
#define YAW_MIN	 -135.0

//-------------------------------------------------- Global Variables

static ConVar cam_command( "cam_command", "0", FCVAR_CHEAT | FCVAR_ARCHIVE );	 // tells camera to go to thirdperson
static ConVar cam_snapto( "cam_snapto", "0", FCVAR_ARCHIVE );	 // snap to thirdperson view
static ConVar cam_idealyaw( "cam_idealyaw", "90", FCVAR_ARCHIVE );	 // thirdperson yaw
static ConVar cam_idealpitch( "cam_idealpitch", "180", FCVAR_ARCHIVE );	 // thirperson pitch
static ConVar cam_idealdist( "cam_idealdist", "300", FCVAR_ARCHIVE );	 // thirdperson distance
static ConVar c_maxpitch( "c_maxpitch", "180", FCVAR_ARCHIVE );
static ConVar c_minpitch( "c_minpitch", "0", FCVAR_ARCHIVE );
static ConVar c_maxyaw( "c_maxyaw",   "135", FCVAR_ARCHIVE );
static ConVar c_minyaw( "c_minyaw",   "-135", FCVAR_ARCHIVE );
static ConVar c_maxdistance( "c_maxdistance",   "200", FCVAR_ARCHIVE );
static ConVar c_mindistance( "c_mindistance",   "30", FCVAR_ARCHIVE );
static ConVar c_orthowidth( "c_orthowidth",   "100", FCVAR_ARCHIVE );
static ConVar c_orthoheight( "c_orthoheight",   "100", FCVAR_ARCHIVE );

yet with all these changes I've only managed to get this effect so far
billtcm-third.JPG


By the way after I compile a ".cpp" do I have to completely exit out of the mod and restart it, or can I just type "restart", or "reload" in console. If you guys can help me I'd appreciate it.
 
what you have seems reasonably normal. your gona want to hide the weapon model and change the yaw to 0 and max and min distance to get it lookign nice. i prefer the distance to be aroudn 100. theres lots of tutorials that will help you with editing the camera.
 
Yeah the thirdperson works, but that's all I can get. I've changed all the values numerous times and it never changes from that side view of the right of the player model. I've changed yaw, pitch, and distance along with their max and min values and nothing changes I always get that side view. And the compile build always says it fails, even when I haven't changed anything.(the original .cpp even says it fails)
 
your deffinetly compiling under release hl2 and not debug. i always make that mistake. otherwise check out the tutorials on the official hl2 wiki that will help you out a great deal with the camera positions and stuff.
 
yeah lol you dont want to have debug on you want to have release half life 2 on. but that tutorial should offer some help
 
lol whoops, no wonder. Thanks crackhead, I'll keep you updated.

Edit:Turns out that was just one small problem, I also hadn't built the solution(that's why it always failed) and my config.cfg kept overriding whatever I put into the "in_camera.cpp". So I just edited the .cfg and everything seems fine now, thanks again for the help crackhead.
 
Back
Top