I'm looking at in_camera.cpp and I have a few questions.

First of all, what is the difference between CAM_Think() and
CAM_ThirdThink()? I was looking to see which one to override in the sdk
files but it appears that CAMThirdThink() is never called.

Secondly, if I override CAM_Think, I don't see how I can control the
"location" of the camera except for distance away from the player. I
thought about how I could do some trig and set the pitch and yaw to
move the camera, but then I'd have to rotate the camera itself back to
look forward. I guess what I'm saying is that I don't see how I can
rotate the camera relative to itself instead of the player. Do I _have_
to use the overrideview function? Can I use trig to set the proper
location of the camera in CAM_Think and then override _only_ the view
angles in OverrideView()?

Secondly, about muzzle flashes. With the weapons from the beta sdk,
they appear to be calling FireObsoleteEvent() in c_baseanimating (its
the only call of that function I can find, on line 3597). Shouldn't it
be calling FireEvent() since the .qc file read AE_NPC_MUZZLEFLASH?

Lastly, I'm trying to replace the old muzzle flashes that it calls with
particle ones I made. So I modified weaponsdk_base.

In ::PrimaryAttack()

Vector vecShootOrigin;
QAngle angShootDir;
GetAttachment( LookupAttachment("muzzle"), vecShootOrigin, andShootDir);
DispatchParticleEffect( "muzzle_test", vecShootOrigin, andShootDir);

pPlayer->DoMuzzleFlash();

This code works, but the muzzle flash comes out of the player's crotch.
While humorous, its not exactly the desired result. The w_smg_mp5.qc
specifies a "muzzle" attachment. Any idea whats going wrong?

Thanks a lot to anyone who can lend an inexperienced coder a hand.

On Sat, 30 May 2009 11:10:52 -0400
Jorge Rodriguez <[email protected]> wrote:

> My mod is far deviated from the standard sources and I don't have
> those lying around, but in my sources the third person camera code is
> in:
> 
> void CSDKInput::CAM_ThirdPersonThink()
> 
> In your code it may be in CInput and you'd have to override it. The
> file you're looking at should be c_sdk_input.cpp/h In that think
> function is where you can put special rules to place the camera where
> you want it to be depending on the position and orientation of the
> player. Also you can force the player into third person all the time
> by issuing a CAM_ToThirdPerson() command somewhere, or perhaps by
> putting "thirdperson" in a config file somewhere.
> 
> I take it you modified OverrideView(), and you're right, that's not
> the best place to do it. In general you should try to only modify
> SDK-specific files and classes, and OverrideView() isn't quite for
> what you're trying to do with it. You don't set the third person
> camera information there, however you should save off the results of
> CAM_ThirdPersonThink and pass them into OverrideView if the player is
> in third person.
> 
> Sorry if this is vague, I'm doing it all from memory! I hope it helps.
> 

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to