trigger_camera

Modified

12-Jul-2023

When triggered, temporarily swaps the player's view with that of the camera, and has the camera follow a path, if set up that way. This is usually used for cut-scenes. Set the camera target to make trigger_camera look at this target, e.g. set it to func_train and camera will look at this func_train (this train need origin brush), you can also use info_target for this. By default, camera moves among path made by path_corners, smooths it's movement in the whole path, and facing target (when no target specified, the camera takes it's angles). Trigger_camera can also detects mouse clicking on different entities and surfaces to perform actions of your choice. Triggering another camera when previous is still playing overrides first camera.

Keyvalues


Target target : Used mostly for targeting camera view by specifying entity to look at (func_train or info_target). In unusual cases this can be used to trigger an entity. It is advised to use "Target when player stops using" and "Target when player starts using" for this.

Delay Before Trigger delay : Delay before trigger entity specified in "Target".

Kill Target killtarget : Entity to remove when camera hold time expires.

OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of trigger_camera so other entities can trigger it display camera view. Depending on trigger use-type: 'On'- enable camera view, 'Off'- disable camera view, 'Toggle'- toggle camera view. Can be kill-targeted but player would get stuck in camera view if removed while using this!

Pitch Yaw Roll (X Y Z) angles : Where Z means Y and Y means Z, that is, when you're thinking Hammer-grid. (Hammer uses Z for height and Y for depth, while every other sane 3D-application does this the other way round; nonetheless this keyvalue description has the letters in the conventional order) This, technically, is a 3D-vector containing Euler-angles to describe either the entity's rotation or direction of effect. E.g. a func_door_rotating will use this as its initial rotation, while a trigger_push will keep its original alignment and use this for the direction of its push-effect instead. Euler-angles are a hierarchical system to determine an object's orientation in 3D-space. A yaw-value of 0 would mean the entity would face east. (right in top-down view) 90 would mean it would face north. (up in top-down-view) After yaw, pitch is applied. Think aiming up/down with your character in first person. At last, the roll-value is applied. Think your character falling over sideways in first person. Some entities, mostly point entities, do not use the angles keyvalue for any purpose.

Hold time wait : How many seconds camera controls player view. Player recovers his view and all camera effects are exterminated after that.

Path Corner moveto : Name of path_corner this camera spawns at. Path_corners are entities that connected with each other creates path. For static camera leave this empty. Supports path_track as well (but does no big difference).

Initial Speed speed : Starting speed of camera when camera is moving.

Acceleration units/sec^2 acceleration : Amount of units the camera accelerates each second (if it's moving). Doesn't work when "Instant Move" is selected.

Stop Deceleration units/sec^2 deceleration : Amount of units the camera accelerates each second (if it's moving). It is not required, the camera actually smooth it's movement very well. Doesn't work when "Instant Move" is selected.

Camera Rotation Speed turnspeed : Camera rotation speed. Camera does not rotate itself as that, it also won't rotate within path_corners/path_tracks (only micro rotations when camera moves smoothly ("Instant Move" not selected) and tries to keep target on the center of the screen). The camera only rotates from starting angle to face it's target when "Instant Turn is selected". The starting angle is a default angle of the camera, if "start at player" is set, the starting angle is a player angle.

Left Click Action mouse_action_0_0 : Action to perform when player clicked with left mouse button.

  • 0 : No Action : No action (disable this feature).
  • 1 : Trigger Off : Trigger clicked entity with 'Off' use-type.
  • 2 : Trigger On : Trigger clicked entity with 'On' use-type.
  • 3 : Trigger Toggle : Trigger clicked entity with 'Toggle' use-type.
  • 4 : Remove : Remove (kill-target) clicked entity.
  • 5 : Hurt : Deal a damage to clicked entity, use "Click Param" to specify damage amount.
  • 6 : Heal : Heal clicked entity, use "Click Param" to specify heal amount.
  • 7 : Spawn : Spawns an entity in clicked location, use "Click Param" to specify entity classname.
  • 8 : Teleport : Teleports specified entity to clicked location, use "Click Param" to specify entity targetname.
  • 9 : Teleport Away : Teleports clicked entity to specified location, use "Click Param" to specify location: targetname, destination(not tested) or coordinates(not tested).
  • 10 : Create Explosion : Creates an explosion effect on clicked surface/entity, no damage.
  • 11 : Drag : Drags entities around.
  • 255 : Exit Camera (Non-forced only) : Close camera view, leave the camera and return to game (only if "Force View" flag is not selected).

Left Click Param mouse_param_0_0 : Some actions from keyvalue above can have parameter specified.

Left Click Block Drag Repeating Action mouse_block_drag_0_0 : When "Mouse Cursor" is enabled, block a repeating action from firing when a mouse button is held down then moved about whilst held, e.g. constantly triggering a door open/close just by holding a mouse button and jittering movement a bit.

  • 0 : No
  • 1 : Yes

Right Click Action mouse_action_1_0 : Action to perform when player clicked with right mouse button.

  • 0 : No Action : No action (disable this feature).
  • 1 : Trigger Off : Trigger clicked entity with 'Off' use-type.
  • 2 : Trigger On : Trigger clicked entity with 'On' use-type.
  • 3 : Trigger Toggle : Trigger clicked entity with 'Toggle' use-type.
  • 4 : Remove : Remove (kill-target) clicked entity.
  • 5 : Hurt : Deal a damage to clicked entity, use "Click Param" to specify damage amount.
  • 6 : Heal : Heal clicked entity, use "Click Param" to specify heal amount.
  • 7 : Spawn : Spawns an entity in clicked location, use "Click Param" to specify entity classname.
  • 8 : Teleport : Teleports specified entity to clicked location, use "Click Param" to specify entity targetname.
  • 9 : Teleport Away : Teleports clicked entity to specified location, use "Click Param" to specify location: targetname, destination(not tested) or coordinates(not tested).
  • 10 : Create Explosion : Creates an explosion effect on clicked surface/entity, no damage.
  • 11 : Drag : Drags entities around.
  • 255 : Exit Camera (Non-forced only) : Close camera view, leave the camera and return to game (only if "Force View" flag is not selected).

Right Click Param mouse_param_1_0 : Some actions from keyvalue above can have parameter specified.

Right Click Block Drag Repeating Action mouse_block_drag_1_0 : When "Mouse Cursor" is enabled, block a repeating action from firing when a mouse button is held down then moved about whilst held, e.g. constantly triggering a door open/close just by holding a mouse button and jittering movement a bit.

  • 0 : No
  • 1 : Yes

Third Click Action mouse_action_2_0 : Action to perform when player clicked with middle mouse button.

  • 0 : No Action : No action (disable this feature).
  • 1 : Trigger Off : Trigger clicked entity with 'Off' use-type.
  • 2 : Trigger On : Trigger clicked entity with 'On' use-type.
  • 3 : Trigger Toggle : Trigger clicked entity with 'Toggle' use-type.
  • 4 : Remove : Remove (kill-target) clicked entity.
  • 5 : Hurt : Deal a damage to clicked entity, use "Click Param" to specify damage amount.
  • 6 : Heal : Heal clicked entity, use "Click Param" to specify heal amount.
  • 7 : Spawn : Spawns an entity in clicked location, use "Click Param" to specify entity classname.
  • 8 : Teleport : Teleports specified entity to clicked location, use "Click Param" to specify entity targetname.
  • 9 : Teleport Away : Teleports clicked entity to specified location, use "Click Param" to specify location: targetname, destination(not tested) or coordinates(not tested).
  • 10 : Create Explosion : Creates an explosion effect on clicked surface/entity, no damage.
  • 11 : Drag : Drags entities around.
  • 255 : Exit Camera (Non-forced only) : Close camera view, leave the camera and return to game (only if "Force View" flag is not selected).

Third Click Param mouse_param_2_0 : Some actions from keyvalue above can have parameter specified.

Third Click Block Drag Repeating Action mouse_block_drag_2_0 : When "Mouse Cursor" is enabled, block a repeating action from firing when a mouse button is held down then moved about whilst held, e.g. constantly triggering a door open/close just by holding a mouse button and jittering movement a bit.

  • 0 : No
  • 1 : Yes

Left Double Click Action mouse_action_0_1 : Action to perform when player double-clicked with left mouse button.

  • 0 : No Action : No action (disable this feature).
  • 1 : Trigger Off : Trigger clicked entity with 'Off' use-type.
  • 2 : Trigger On : Trigger clicked entity with 'On' use-type.
  • 3 : Trigger Toggle : Trigger clicked entity with 'Toggle' use-type.
  • 4 : Remove : Remove (kill-target) clicked entity.
  • 5 : Hurt : Deal a damage to clicked entity, use "Click Param" to specify damage amount.
  • 6 : Heal : Heal clicked entity, use "Click Param" to specify heal amount.
  • 7 : Spawn : Spawns an entity in clicked location, use "Click Param" to specify entity classname.
  • 8 : Teleport : Teleports specified entity to clicked location, use "Click Param" to specify entity targetname.
  • 9 : Teleport Away : Teleports clicked entity to specified location, use "Click Param" to specify location: targetname, destination(not tested) or coordinates(not tested).
  • 10 : Create Explosion : Creates an explosion effect on clicked surface/entity, no damage.
  • 11 : Drag : Drags entities around.
  • 255 : Exit Camera (Non-forced only) : Close camera view, leave the camera and return to game (only if "Force View" flag is not selected).

Left Double Click Param mouse_param_0_1 : Some actions from keyvalue above can have parameter specified.

Left Double Click Block Drag Repeating Action mouse_block_drag_0_1 : When "Mouse Cursor" is enabled, block a repeating action from firing when a mouse button is held down then moved about whilst held, e.g. constantly triggering a door open/close just by holding a mouse button and jittering movement a bit.

  • 0 : No
  • 1 : Yes

Right Double Click Action mouse_action_1_1 : Action to perform when player double-clicked with right mouse button.

  • 0 : No Action : No action (disable this feature).
  • 1 : Trigger Off : Trigger clicked entity with 'Off' use-type.
  • 2 : Trigger On : Trigger clicked entity with 'On' use-type.
  • 3 : Trigger Toggle : Trigger clicked entity with 'Toggle' use-type.
  • 4 : Remove : Remove (kill-target) clicked entity.
  • 5 : Hurt : Deal a damage to clicked entity, use "Click Param" to specify damage amount.
  • 6 : Heal : Heal clicked entity, use "Click Param" to specify heal amount.
  • 7 : Spawn : Spawns an entity in clicked location, use "Click Param" to specify entity classname.
  • 8 : Teleport : Teleports specified entity to clicked location, use "Click Param" to specify entity targetname.
  • 9 : Teleport Away : Teleports clicked entity to specified location, use "Click Param" to specify location: targetname, destination(not tested) or coordinates(not tested).
  • 10 : Create Explosion : Creates an explosion effect on clicked surface/entity, no damage.
  • 11 : Drag : Drags entities around.
  • 255 : Exit Camera (Non-forced only) : Close camera view, leave the camera and return to game (only if "Force View" flag is not selected).

Right Double Click Param mouse_param_1_1 : Some actions from keyvalue above can have parameter specified.

Right Double Click Block Drag Repeating Action mouse_block_drag_1_1 : When "Mouse Cursor" is enabled, block a repeating action from firing when a mouse button is held down then moved about whilst held, e.g. constantly triggering a door open/close just by holding a mouse button and jittering movement a bit.

  • 0 : No
  • 1 : Yes

Third Double Click Action mouse_action_2_1 : Action to perform when player double-clicked with middle mouse button.

  • 0 : No Action : No action (disable this feature).
  • 1 : Trigger Off : Trigger clicked entity with 'Off' use-type.
  • 2 : Trigger On : Trigger clicked entity with 'On' use-type.
  • 3 : Trigger Toggle : Trigger clicked entity with 'Toggle' use-type.
  • 4 : Remove : Remove (kill-target) clicked entity.
  • 5 : Hurt : Deal a damage to clicked entity, use "Click Param" to specify damage amount.
  • 6 : Heal : Heal clicked entity, use "Click Param" to specify heal amount.
  • 7 : Spawn : Spawns an entity in clicked location, use "Click Param" to specify entity classname.
  • 8 : Teleport : Teleports specified entity to clicked location, use "Click Param" to specify entity targetname.
  • 9 : Teleport Away : Teleports clicked entity to specified location, use "Click Param" to specify location: targetname, destination(not tested) or coordinates(not tested).
  • 10 : Create Explosion : Creates an explosion effect on clicked surface/entity, no damage.
  • 11 : Drag : Drags entities around.
  • 255 : Exit Camera (Non-forced only) : Close camera view, leave the camera and return to game (only if "Force View" flag is not selected).

Third Double Click Param mouse_param_2_1 : Some actions from keyvalue above can have parameter specified.

Third Double Click Block Drag Repeating Action mouse_block_drag_2_1 : When "Mouse Cursor" is enabled, block a repeating action from firing when a mouse button is held down then moved about whilst held, e.g. constantly triggering a door open/close just by holding a mouse button and jittering movement a bit.

  • 0 : No
  • 1 : Yes

Mouse Digital Action Reset Time mouse_digital_action_reset : When "Mouse Cursor" is enabled, change the wait/reset time between each digital mouse action, though there is still a minimum of 0.01 (10ms). Digital mouse action including clicking, double-clicking and wheel up/down. This doesn't apply to analogue actions, being moving or dragging.

AS Mouse Event Callback Name m_iszASMouseEventCallbackName : Name of AngelScript method to call on camera mouse events.

AS Key Input Callback Name m_iszASKeyInputCallbackName : Name of AngelScript method to call on camera input events.

Set Player Targetname m_iszOverridePlayerTargetname : Set player's targetname to new value when they use the camera, and revert those changes after finishing using it.

Target when player starts using m_iszTargetWhenPlayerStartsUsing : Target to trigger when player starts using this camera.

Target when player stops using m_iszTargetWhenPlayerStopsUsing : Target to trigger when player stops using this camera.

Target when turned off m_iszTurnedOffTarget : Target to trigger when camera is turned off (e.g. when camera hold time expires).

Max Players max_player_count : Maximum number of players that can be using this camera at once, only applicable when "All players" flag is disabled.

Target: Player tried to use, but Max Players reached max_player_target : Entity to trigger when player attempts to use the camera but "Max players" limit has been reached.

HUD: Health and Battery hud_health : Specify if health and battery counters hud elements should be hidden during camera view.

  • 0 : Show Health and Battery
  • 1 : Hide Health and Battery

HUD: Flashlight hud_flashlight : Specify if flashlight indicator hud element should be hidden during camera view.

  • 0 : Show Flashlight
  • 1 : Hide Flashlight

HUD: Weapons hud_weapons : Specify if weapon belt and ammo bar hud elements should be hidden during camera view.

  • 0 : Show Weapons
  • 1 : Hide Weapons

Custom Cursor (Sprite) cursor_sprite : Name of custom sprite that will be used as the mouse cursor during camera view.

Flags


  • 1 : Start At Player : Camera starts at player position, after that it will gradually switch to path_corner route. If no path_corner specified, the camera will move at the direction the player was looking at and won't stop until hold time reach it's limit.

  • 2 : Follow Player : Uses player (!activator) as a target to looking at.

  • 4 : Freeze Player : Players can't move until end of camera movement.

  • 8 : All Players : All players will be affected by trigger_camera (not only the !activator).

  • 16 : Force View : Force camera view whenever player is dead or not.

  • 32 : No Instant Turn : If selected, the camera won't smooths its rotation FROM starting angles TO face target, instead it will turn instantaneously. If "Start at Player" is selected, the player's facing direction is the camera starting angle. If flag is not selected, the camera start facing it's target, and the rotation speed is non-functional. If no "Target" specified, the flag is obsolete.

  • 64 : Instant Move : If selected, the camera is moving from path to path without any movement smoothing.

  • 128 : Mouse Cursor : Enable mouse cursor. Now all trigger_cameratarget entities are allowed to be clicked (until hold time ends).

  • 256 : Player Invulnerable : Players cannot be hurt when view is swapped. Use it as often as possible to avoid monster attacking you while cutscene is in progress.

  • 512 : Ignore Hold Time : Camera ignores hold time and will be turned off when re-triggered.

The best way to make camera rotate is to "Target" the entity. The camera will face entity specified in "Target" field, it could be info_target, monster or even another train. If you make a train that moves in a same path as trigger_camera, but it's a little further in a path, the camera will face always the direction that it moves.

When targeting func_train or other brush-based entity, the ORIGIN brush tied to those entities is required.