View roll: Difference between revisions
Jump to navigation
Jump to search
Note:Works on all branches.
Tip: If you want users to be able to change the value when
m (jesus this is the third time i edited this page in 1 minute) |
No edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[[File:Viewrolling demonstration.gif|320px|thumb|right|View rolling demonstration.<br>(Click to view if GIF does not play automatically).]] | |||
This page shows you how to add the view rolling effect, which is used in {{hl|2}}, {{bms|2}}, and {{quake|2}} to your mod. | |||
{{note|''Works on all branches.''}} | {{note|''Works on all branches.''}} | ||
Line 6: | Line 7: | ||
First, go to '''movevars_shared.cpp''' and search around line 82 for this: | First, go to '''movevars_shared.cpp''' and search around line 82 for this: | ||
< | <syntaxhighlight lang=cpp> | ||
ConVar sv_rollangle ( "sv_rollangle", "0", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle"); | ConVar sv_rollangle ( "sv_rollangle", "0", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle"); | ||
</ | </syntaxhighlight> | ||
Change the 0 to anything between 0 and 10. | Change the 0 to anything between 0 and 10. | ||
Example: | Example: | ||
< | <syntaxhighlight lang=cpp> | ||
ConVar sv_rollangle ( "sv_rollangle", "3", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle"); | ConVar sv_rollangle ( "sv_rollangle", "3", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle"); | ||
</ | </syntaxhighlight> | ||
{{tip| If you want users to be able to change the value when <code>sv_cheats</code> is enabled, replace FCVAR_DEVELOPMENTONLY with FCVAR_CHEAT}} | |||
After that, compile your mod and you ''should'' have view rolling in your mod. | After that, compile your mod and you ''should'' have view rolling in your mod. | ||
[[Category:Camera]] [[Category:Programming]] |
Latest revision as of 08:32, 11 April 2025
This page shows you how to add the view rolling effect, which is used in Half-Life,
Black Mesa, and
Quake to your mod.

The code
First, go to movevars_shared.cpp and search around line 82 for this:
ConVar sv_rollangle ( "sv_rollangle", "0", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle");
Change the 0 to anything between 0 and 10. Example:
ConVar sv_rollangle ( "sv_rollangle", "3", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle");

sv_cheats
is enabled, replace FCVAR_DEVELOPMENTONLY with FCVAR_CHEATAfter that, compile your mod and you should have view rolling in your mod.