Talk:Third-person camera

From Valve Developer Community
Revision as of 12:55, 4 March 2006 by ^Ben (talk | contribs)
Jump to: navigation, search

Offset issue..

Im trying to make my third person camera an over-the-shoulder type view such as Ghost Recon 2. This third person camera is implemented, where and how do i offset the view?

RightView Fix in the CFG file! Important!!

Just found the problem with the camera being placed to the right of the player. It seems that the mentioned fix doesn't work if you have already run your mod before. This is because the 90 degree value for cam_idealyaw gets saved to a config file. The config file can be found in Steam\SteamApps\SourceMods\MY_MOD_DIR\cfg\config.fcg. You can open it up and change

cam_idealpitch "90"

to this

cam_idealpitch "0"

Or if you're realy lazy and don't mind loosing your key-bindings and other configurations, just delete it so it gets regenerated.

--Sunblaze 18:53, 19 Jul 2005 (PDT)

Yah, I forgot to mention that. I added it in. --SubKamran 20:32, 19 Jul 2005 (PDT)

Player animations

Probably not the right place for this, but I couldn't find any other suitable page.. I've successfully implemented third-person camera, and constructed an entity that can change the player model on the fly. But the player model won't do any animations, it just floats which is really annoying. Does anyone know how to make the player do some animations? --.freelancer 13:23, 29 Nov 2005 (PST)

I can't help you with this, but to help those who can, you might need to say what you've tried and what method you use to change the player model. —Maven (talk) 17:08, 29 Nov 2005 (PST)
Since I'm rather new to the Source engine I haven't tried much to get the animations working, I really don't know how to start. To change the model I get a pointer to the local player (with UTIL_GetLocalPlayer()) and use the SetModel function. Since the model needs to be precached, the model has to already be somewhere in the map. --.freelancer 01:31, 30 Nov 2005 (PST)

the server should control the player's model...—ts2do (Talk | @) 17:49, 30 Nov 2005 (PST)

It's a single-player mod..--.freelancer 07:26, 1 Dec 2005 (PST)

server still control's player for "player.mdl"—ts2do (Talk | @) 17:06, 1 Dec 2005 (PST)

Why should the server care about a purely graphical aspect? —Maven (talk) 17:32, 1 Dec 2005 (PST)

because that's how it does it—ts2do (Talk | @) 17:50, 1 Dec 2005 (PST)

Eh. Perhaps that will teach me not to ask rhetorical questions. —Maven (talk) 17:59, 1 Dec 2005 (PST)

@Ts2do: I know how to switch model, that's not the issue. The problem is the new model is only using one animation (if you could even call it that), just like the original player.mdl... --.freelancer 01:54, 2 Dec 2005 (PST)

How bout making a SP mod from the HL2MP SDK, which already controls player animations—ts2do (Talk | @) 05:59, 2 Dec 2005 (PST)

Do I still have all of the SP code available? I know visual stuff like materials and models won't be available..--.freelancer 10:48, 2 Dec 2005 (PST)
It might to better to look at the MP code instead of switching to it, and copy-paste what you need from it. —Maven (talk) 12:53, 2 Dec 2005 (PST)
Yeah, probably. Still don't really know where to look though.. --.freelancer 13:15, 2 Dec 2005 (PST)

Materials and models? You can treat it like it was a SP mod still by utilizing the hl2 base content... how are you doing animations in the player mdl? are you using the male_anim and female_anim or whatever it is...that will only work in MP coz that's what the file is in

Of course if you were to use those animations, you'd need to rename the whole system because NPCs used the anims from the base content—ts2do (Talk | @) 18:21, 2 Dec 2005 (PST)

So basically it would be easier just to create the mod with the MP SDK? Right now I haven't changed anything about the animation system, that's why the player mdl isn't using any animations. That's what I need help with. But using the MP SDK would make that possible more or less without any extra coding? --.freelancer 03:25, 3 Dec 2005 (PST)

Well...Eclipse did it without any MP code I think...try checking out their player mdl

Otherwise...yes MP would work, but you'd have to resolve the issue with NPC animations and PLR animations—ts2do (Talk | @)

Let's see if I got this right. If I use SP SDK my player animations won't work without lots of coding, and if I use MP SDK my NPC animations won't work without lots of coding? Maybe I should just make the mod first-person.. --.freelancer 17:12, 3 Dec 2005 (PST)

With this tutorial, I borrowed the Eclipse player model. The jump animation works, as well as the IDLE animation. In the code there is a place where animations are defined... I didn't mess with it enough to see if I could get the run animation working. But you basically reference the animation in player.mdl. You could also head to the Eclipse forums and send them a PM; PM the programmer "Resforjen." He was the one who got the animations in and working. --SubKamran 07:10, 25 Feb 2006 (PST)

There was a post in VERC about how to add animation in thirdperson view to a single player mod. Will this help? -n-neko 07:54, 25 Feb 2006 (PST)

Free camera

I tried to implement a third person camera that works just like the "free chase cam" known from many mods. "Free" means you can look around with the mouse, but the player model doesn't rotate to where you look at. I dug into all code related to player entities and camera movement. At some point the view angles of the player get synchronized with the angles of the player model, but I couldn't find it. :/ -- Koraktor

Random crashes in a clean SDK

Anybody tried the advanced SDK? This will randomly crash for me. Maybe I can get once or twice without it crashing.