entityguide‎ > ‎

trigger_camera

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). Triggering another camera when previous is still playing overrides first camera.
Keyvalues

"AS Mouse Event Callback Name", m_iszASMouseEventCallbackName:
Name of AngelScript method to call on camera mouse events. Visit Sven Coop forums for more.

"AS Key Input Callback Name", m_iszASKeyInputCallbackName:
Name of AngelScript method to call on camera input events. Visit Sven Coop forums for more.

"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 the 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.

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

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

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

"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 opath_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). Seems to not working for camera. It is not required anyway, 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.

"Click Action/Param", <different>:
When "Mouse Cursor" is enabled, those are actions to perform when certain entities/surfaces are clicked with mouse:
  • Trigger Off: triggers clicked entity with 'Off' state
  • Trigger On: triggers clicked entity with 'On' state
  • Trigger Toggle: triggers clicked entity with 'Toggle' state
  • Remove: removes clicked entity from the world
  • Hurt: deal a damage to clicked entity (Parameter = damage to deal)
  • Heal: heal a clicked target (Parameter = heal amount)
  • Spawn: spawns an entity in clicked location (Parameter = entity to spawn)
  • Teleport: teleports to clicked location (Parameter = targetname of entity to teleport)
  • Teleport Away: teleports clicked entity (Parameter = targetname, destination or coordinates)
  • Create Explosion: creates an explosion effect on clicked surface/entity, no damage
  • Drag: drags entities around
  • Exit Camera: close camera view, leave the camera and return to game (only if 'Force View' flag is not selected)

"Block Drag Repeating Action", <different>:
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.

"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.


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's rotation FROM starting angles TO face target, instea it will turn instantanously. 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 then retriggered.

Notes

  • 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.

Changes
  • 5.06: Added 'Exit Camera' action parameter in all 'Click Action/Param' keyvalues.
  • 5.11: Added 'AS Mouse Event Callback Name', (...) and 'Custom Cursor (Sprite)' keyvalues, changes 'No Instant Turn' flag,
    added 'Ignore Hold Time' flag.
  • 5.15: Added 'AS Key Input Callback Name' keyvalue.
  • 5.23: Added 'Block Drag Repeating Action' and 'Mouse Digital Action Reset Time' keyvalues.


Comments