# ezQuake Manual: Camera scripting

Advanced spectator/demo camera control.

This client allows you to script camera behaviour by changing it's position and angles via QuakeWorld scripting.
We have made for you cams.cfg. How to use this script:

1. Download it and save it into <quake>/ezquake/cfg directory
2. Go to the client and type
   `/exec cfg/cams`
3. Now use keys `0, 1, ... 9` in combination with [Shift] and [Ctrl] to load, save and move through camera bookmarks. Each key of 0, 1, ..., 9 serves as a bookmark slot where exact camera position is stored. More detailed info will be printed on your screen when you exec the config (step 2)

In case you want to script something for you own, detailed description of camera scripting commands, variables and macros follows. However you don't need to know them to use cams.cfg from above.

### Variables

    cam_thirdperson - in track mode, we look at the person being tracked rather than through his eyes
    cam_dist - for use with cam_thirdperson. Use +forward/+back to adjust it smoothly
    cam_lockdir - JSS wanted this (use with thirdperson OFF)
    cam_lockpos - experimental (use with thirdperson OFF)
    cam_zoomspeed, cam_zoomaccel - to control how fast you zoom in onto the target with +forward/+back in cam_thirdperson mode

### Commands

    cam_pos - show current position
    cam_pos x y z or cam_pos "x y z" - set new position
    cam_angles - show angles
    cam_angles pitch yaw or cam_angles "pitch yaw" - set new angles

cam_pos and cam_angles can be used to set your position and angles both during demo playback and in spectator mode.

### Macros to get current values

- $cam_pos
- $cam_pos_x
- $cam_pos_y
- $cam_pos_z
- $cam_angles
- $cam_angles_pitch
- $cam_angles_yaw
- $cam_angles_roll -- (always zero, someone may want to make it work one day)

### Triggers

f_captureframe will get executed on the beginning of each new captured frame.

Last update: 23.09.2006 04:28 PDT, made by JohnNy_cz | ezQDocs