Talk:Third-person camera

From Valve Developer Community
Revision as of 05:19, 15 August 2006 by JKyle (talk | contribs) (HL2MP ..)

Jump to: navigation, search

SDK Update

After the latest update, the camera will now penetrate the walls and ignore the code to stop it from doing so. --Mflux 01:06, 8 Aug 2006 (PDT)

This is with all the code fixes?—ts2do 01:56, 8 Aug 2006 (PDT)
Indeed it is. You can try it for yourself, 100% reproducable. I will try it again tonight myself just to be sure. --Mflux 14:15, 11 Aug 2006 (PDT)

HL2MP ..

Im trying to get the animations working for MP in third person. Any Ideas?

Should work fine. Under in_camera there's a few lines forcing no third person feature in multiplayer. Comment them out.

To find them, search "thirdperson" in that file.

Note that there are a ton of animation problems with MP. From the newest SDK if you follow this tutorial exactly the upper body animations may probably work but it will not be interpolated. I'm hoping someone can figure this out. --Mflux 21:48, 10 Aug 2006 (PDT)

New discovery: if you've implemented the third person camera, and turn on UseClientsideAnimation() in hl2mp_player.cpp constructor, the arms will be perfectly animating but the legs will no longer be animating. I've traced the problem to something resetting the leg animations back to frame zero, though I can't find what's resetting it. Any clues?--Mflux 14:20, 11 Aug 2006 (PDT)

I've been trying to implement the third person camera in MP, but when I start a game and use the +camchange console command, I get several "Bad pstudiohdr in GetSequenceLinearMotion()" errors followed by a crash. This is the first I've done with Source modding, so I'm at a bit of a loss as to what this error means or how to remedy it, and Google's not turning up anything useful.--JKyle 22:19, 14 Aug 2006 (PDT)

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?

Try doing cam_idealdist 50 and cam_snapto 1 in console. It should give you a relatively closer camera position than what the default lists in this article. I'm not sure how you would shift it to the left or right, but it shouldn't be too difficult. --Mflux 14:17, 11 Aug 2006 (PDT)

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)
The reason is because the way the game is setup, all animations are driven via server and sent to the client, but the client also does a few things for prediction. This is so even on a single player game, though the effects are negligent.--Mflux 14:22, 11 Aug 2006 (PDT)

@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.