Difference between revisions of "Talk:Third-person camera"
(RE4 or Ghost Recon Camera Offset)
(Changing Player Model)
|Line 138:||Line 138:|
--[[User:Bnewsom|Bnewsom]] 16:32, 5 May 2007 (PDT)
--[[User:Bnewsom|Bnewsom]] 16:32, 5 May 2007 (PDT)
Revision as of 18:39, 31 May 2007
- 1 Basic Error Type
- 2 SDK Update
- 3 HL2MP ..
- 4 Offset issue..
- 5 RightView Fix in the CFG file! Important!!
- 6 Player animations
- 7 Free camera
- 8 Random crashes in a clean SDK
- 9 Free roaming camera
- 10 Anims section: Line 74 should read 174
- 11 Transparency + DrawWeapon
- 12 RE4 or Ghost Recon Camera Offset
- 13 Changing Player Model
Basic Error Type
Hrm. Followed everything but I get a 'Unknown Command +camchange' Is this still compatible via VS2005? Furthermore,
== the above code needs to go inside hl2_player.cpp. this then needs to be defined in hl2_player.h so at line 74 put: void SetAnimation ( PLAYER_ANIM playerAnim ); ==
Line 74 is part of a comment. So, what class specifically does it go under?
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)
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)
- That error means your player doesn't have a model. I would recommend getting used to the sdk before diving into this—ts2do 10:04, 15 Aug 2006 (PDT)
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
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)
I found that my cam_idealpitch was already set to 0, yet the cam_idealyaw was set to 90, once this was changed to 0, everything was fine. --Neptar 16:44, 21 Feb 2007 (PST)
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)
- It's a single-player mod..--.freelancer 07:26, 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)
- 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)
- 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
- 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
- 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)
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.
Free roaming camera
I'm working on a project which needs a camera that's not bound to any one player. I've just begun to dive into the code and the third-person camera is easy enough to get working, but I'm having trouble figuring out where to go from there. It appears that all the camera's calculations eventually wind up in m_vecCameraOffset, and the elements of m_vecCameraOffset represent the camera's pitch, yaw, and distance from player model respectively. Does that mean Source has no built-in system for a basic two-vector eye/target camera? And if I have to roll my own, where might I start? --Dphrygian 15:09, 1 Sep 2006 (PDT)
- Never mind, I found what I was looking for. It's CViewSetup, should anyone else be looking for it. --Dphrygian 15:22, 1 Sep 2006 (PDT)
Anims section: Line 74 should read 174
"The above code needs to go inside hl2_player.cpp. this then needs to be defined in hl2_player.h so at line 74 put: void SetAnimation ( PLAYER_ANIM playerAnim );"
Im -almost certain- about this. I couldnt get it to work with anim and putting that line of code at 74 causes the build not to work. Putting it at line 174 makes more sense and did work for me.
Im not personally confident enough to edit the article seeing as its only the second bit of HL2/C++ coding that Ive done in my life. Anyone fancy taking a look at the code and confirming this? --Poi 09:35, 28 Feb 2007 (PST)
Transparency + DrawWeapon
Are there issues with using both transparency and drawing the weapon when in third person?
It seems like it's a "one or the other" affair. If I switch the commented lines in the c_basecombatweapon.cpp file, then the weapon is drawn in third person, but transparency when the camera gets close to the player no longer works. Is there a fix for this? Can we have both?
RE4 or Ghost Recon Camera Offset
Ive been having trouble finding out how to offset the camera so the effect makes the camera as if it was panned the the right of the player instead of focusing directly toward the origin of the eyes. How would I be able to accomplish the effect of a thirdperson over-the-shoulder camera as seen in Resident Evil 4 or Ghost Recon?
A theory would be to create a function that can be defined through #define xoffset 10 and #define yoffset 2. I don't have much experience in coding so can anyone help me out here? Thanks!
--Bnewsom 16:32, 5 May 2007 (PDT)
Changing Player Model
I'm doing a single-player mod. The tutorial mentions changing the player model to sorta "test" the work. How do you do that? --Charron