Quake strafing: Difference between revisions
Jump to navigation
Jump to search

(Created page with "{{Language subpage}} This method will allow you to make the {{hl|4}} more dynamic. All work is done on the client side. And add {{quake|4|addtext=-style}} strafes. Open ''view...") |
m (Nesciuse moved page Quake strafing/en to Quake strafing without leaving a redirect: Move en subpage to basepage) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
This method will allow you to make the {{hl|4}} more dynamic. All work is done on the client side. And add {{quake|4|addtext=-style}} strafes. | This method will allow you to make the {{hl|4}} more dynamic. All work is done on the client side. And add {{quake|4|addtext=-style}} strafes. | ||
Open ''view.cpp'' in ''cl_dll'' and go down to the ''V_CalcViewRoll'' function. | Open ''view.cpp'' in ''cl_dll'' and go down to the ''V_CalcViewRoll'' function. | ||
Line 28: | Line 29: | ||
The screen will now tilt like [[Quake]] or [[DMC]] when strafes. You can change the number 4 to your liking, this is the tilt factor, that is, the larger this value, the more the screen tilts. | The screen will now tilt like [[Quake]] or [[DMC]] when strafes. You can change the number 4 to your liking, this is the tilt factor, that is, the larger this value, the more the screen tilts. | ||
[[Category:GoldSrc_Programming]] | |||
[[Category:GoldSrc_Tutorials]] |
Latest revision as of 10:18, 12 July 2024


This method will allow you to make the Half-Life more dynamic. All work is done on the client side. And add
Quake-style strafes.
Open view.cpp in cl_dll and go down to the V_CalcViewRoll function.
Way
1. Add two new strings:
extern cvar_t *cl_rollspeed;
extern cvar_t *cl_rollangle;
2. Remove the lines:
float side;
side = V_CalcRoll ( viewentity->angles, pparams->simvel, pparams->movevars->rollangle, pparams->movevars->rollspeed );
3. Replace the line:
pparams->viewangles[ROLL] += side;
With:
pparams->viewangles[ROLL] = V_CalcRoll (pparams->viewangles, pparams->simvel, cl_rollangle->value, cl_rollspeed->value ) * 4;
4. It remains only to declare two new variables cl_rollspeed and cl_rollangle. Go to hud.cpp and somewhere after the header files add two new lines:
cvar_t *cl_rollspeed;
cvar_t *cl_rollangle;
5. Scroll down to void CHud
Init( void ) and stick it in there:
cl_rollangle = gEngfuncs.pfnRegisterVariable ( "cl_rollangle", "0.65", FCVAR_CLIENTDLL|FCVAR_ARCHIVE );
cl_rollspeed = gEngfuncs.pfnRegisterVariable ( "cl_rollspeed", "300", FCVAR_CLIENTDLL|FCVAR_ARCHIVE );
The screen will now tilt like Quake or DMC when strafes. You can change the number 4 to your liking, this is the tilt factor, that is, the larger this value, the more the screen tilts.