Tremulous Forum
Mods => Modding Center => Topic started by: LANS on November 10, 2008, 04:47:54 am
-
How do I reduce or eliminate friction so that when a player is moving in a direction, he keeps moving in that direction until he tries to move in another direction using the wasd keys or whatever he has set for movement? I've tried setting the regular friction parameter in bg_pmove.c to 0.0f, but it doesn't change anything, even if I just walk in a straight line. What do I have to change to make this happen?
On an unrelated note, I've also had little luck in finding how to make third-person-view default, and how to set it so that the camera stays pointing north-up regardless of how the player is turned.
Also, how do I find out which direction the player is aiming, be it either with two angles or a 1-unit-length vec3t?
Thanks
-
friction is defined per class in bg_misc.c (the variable at the top of bg_pmove.c is left over from q3 and unused).
you'll need to look at the cg_thirdperson code to make it always on.
the camera origin/angles are taken from cg.refDef, by default they are copied out of your predicted player state.
-
I'm sure a simple .cfg could default-erize cg_thirdperson 1.
seta cg_thirdperson 1
Correct me if I'm wrong by all means. Any excuse to further extend my knowledge.
-
using the thirdperson command will switch to thirdperson, but it won't do it quite how I want. I've found the thirdperson camera code in cg_view.c, but I can't find where that code is called from.
I want to set the cg.refdefviewAngles[YAW] to something like
vec3_t facing
VectorCopy(<code to find where the player is facing, not sure the playerstate command I need>, facing)
cg.refdefviewAngles[YAW] = 360 - (bunch of math to figure out which angle the player is facing using facing[0] and facing[1], I need to brush up on my CAST rules)
-
just auto enable cg_thirdperson 1...its not hard