Skip to content

Camera Tools

Wiethoofd edited this page Mar 23, 2019 · 5 revisions

ConVars

  • ce_cameratools_show_mode: Displays the current spec_mode in the upper right hand corner of the screen. Mostly useful for debugging, or for learning how spec_mode changes based on various view positions.
  • ce_cameratools_autodirector_mode: When letting the autodirector control the camera, forces the camera mode to this spec_mode.
  • ce_cameratools_fix_view_heights: Fixes player view height inconsistency between POV & STV (lines up sniper scope)
  • ce_cameratools_force_target: Forces the camera target to this player index.
  • ce_cameratools_force_valid_target: Prevents the camera from spectating invalid targets.
  • ce_cameratools_spec_player_alive: Prevents the camera from being able to switch to dead players.
  • ce_cameratools_spec_pos: Moves the camera to a given position and angle.
    • Usage: ce_cameratools_spec_pos x [y] [z] [pitch] [yaw] [roll] [mode].
      • If any of the parameters are ? or omitted, they are left untouched.
      • Mode can be either fixed or free.
  • ce_cameratools_spec_class: Spectates players by class.
    • Usage: ce_cameratools_spec_class <team> <class> [index]
      • Team can be either blu or red.
      • Class can be scout, soldier/solly, pyro, demo, heavy, engineer/engie, medic, sniper, or spy.
      • Index is the index of the player you want to spectate. If omitted, it will just cycle through all players on that team+class.
  • ce_cameratools_spec_steamid: Spectates a player by steamed.
  • ce_cameratools_spec_index: Spectates a player based on their position on the hud.
    • Usage: ce_cameratools_spec_index <team> <index>
      • Team can be either red or blue.
      • Index is the zero-based index of the player on the hud.
  • ce_cameratools_show_users: Prints all players connected to the server and their steamids, for the purpose of creating aliases for spectating specific players.

Thirdperson Lock

Thirdperson lock is a feature that replaces the default, freely orbiting second-person camera with one that uses fixed angles.

ConVars

  • ce_tplock_enable: Enables tplock.
  • ce_tplock_default_pos: Camera x/y/z offset from ce_tplock_bone when tplock is enabled.
  • ce_tplock_default_angle: Camera angle offset (pitch/yaw/roll) from ce_tplock_bone when tplock is enabled.
  • ce_tplock_default_dps: Max degrees per second for angle (pitch/yaw/roll). Set to < 0 to uncap.
  • ce_tplock_taunt_enable: Forces the camera into thirdperson lock (using ce_tplock_taunt_ values) when taunting. Does not require ce_tplock_enable.
  • ce_tplock_taunt_pos: Camera x/y/z offset from ce_tplock_bone when taunting with taunt tplock enabled.
  • ce_tplock_taunt_angle: Camera angle offset (pitch/yaw/roll) from ce_tplock_bone when taunting with taunt tplock enabled.
  • ce_tplock_taunt_dps: Max degrees per second for angle (pitch/yaw/roll) when taunting with taunt tplock enabled. Set to < 0 to uncap.
  • ce_tplock_bone: Bone to attach camera position to.

A word on _pos, _angle, and _dps tplock cvars

The _pos, _angle, and _dps tplock cvars contain x, y, and z (or pitch, yaw, and roll) values all in one string. For example, the default value for ce_tplock_default_pos is 18 -80 20, which means the camera is offset 18 units right, 80 units back, and 20 units up.

The _dps cvars are just three whitespace-separated floats, each one specifying the maximum number of degrees per second the camera can move on that axis. They default to -1 -1 -1, meaning that the camera angles are unclamped and free to change angle at any speed.

The _angle cvars are more flexible (and thus more complicated). For each value in the angle cvars (there are 3, pitch/yaw/roll), these are the possible configurations:

Value Description
? Uses the player's view angle, unchanged.
<float> Adds to the player's view angle.
+/-<float> Adds/subtracts from the player's view angle.
=<float> Assigns the angle to a single, unchanging value that is not based on the player's view angle at all.
*<float> Multiplies the player's view angle by a value.
*<float>+/-<float> Multiplies the player's view angle by a value, then adds/subtracts a constant from that value.

For example, the default value for ce_tplock_default_angle is *0.5 ? =0. This means:

  • Pitch multiplied by 0.5. This limits the actual pitch of the camera between -45 and +45 degrees. This gives a sense of the player looking up or down, without making your viewers want to puke.
  • Yaw passed through unchanged.
  • Roll locked to 0. We don't ever want our camera to roll, that would look weird.
Clone this wiki locally