Hooks called by Screen Effects

Summary

Hooks

Lets plugins change the shake of the view that follows a landing.
Lets plugins change the headbob of the local player.
Lets plugins change the next beat of the low health heartbeat.
Lets plugins change what the screen passes of the Screen Effects plugin draw.
Lets plugins change what the Screen Effects plugin adds to the view angles of the local player.
Asks whether one of the effects of the Screen Effects plugin should be applied to the local player.

Hooks

AdjustFallShake(info, speed)

client plugins/screeneffects/plugin/cl_plugin.lua:628

Lets plugins change the shake of the view that follows a landing. Called on the client when the local player lands on their feet faster than the fall shake needs, while the 'headbob' effect is applied. Change the fields in place; do not return anything from the handler, or the plugins after it are not asked.

Parameters

  • info Map the shake: pitch (Number degrees the view dips at most), roll (Number degrees the view wobbles sideways, the sign being the side it starts on) and duration (Number seconds, 0 for no shake)
  • speed Number downward speed right before the landing, in units per second

Called from

Call sites

Lets plugins change the headbob of the local player. Called on the client eight times a second while the player is alive, on foot and on the ground and the 'headbob' effect is applied, also when they stand still, in which case every field is 0. The view follows the result smoothly. Change the fields in place; do not return anything from the handler, or the plugins after it are not asked.

Parameters

  • info Map the headbob: speed (Number how fast the sway cycles, in radians per second), pitch, yaw and roll (Number degrees of sway on each axis) and lean (Number degrees the view is rolled to one side, positive to the right)

Called from

Call sites

AdjustHeartbeat(info, fraction)

client plugins/screeneffects/plugin/cl_plugin.lua:567

Lets plugins change the next beat of the low health heartbeat. Called on the client right before every beat, which is not every frame. Change the fields in place; do not return anything from the handler, or the plugins after it are not asked.

Parameters

  • info Map the beat: interval (Number seconds until the beat after this one, at least 0.1), volume (Number 0 to 1, 0 skips this beat) and pitch (Number percent, 100 being the normal pitch)
  • fraction Number how much of their health the local player has left, 0 to 1

Called from

Call sites

AdjustScreenEffects(adjusted_screen)

client plugins/screeneffects/plugin/cl_plugin.lua:448

Lets plugins change what the screen passes of the Screen Effects plugin draw. Called on the client eight times a second while the local player is in the game with a character, with what the low health and the underwater effect would draw on their own, and also when these effects are turned off, in which case the values are neutral. A field that a handler changes keeps the value it was given until the hook runs again; the others go on following the effects every frame. Change the fields in place; do not return anything from the handler, or the plugins after it are not asked.

Parameters

  • screen Map values of the passes: saturation (Number, 1 leaves the colors alone and 0 is gray), brightness (Number, 0 leaves it alone), contrast (Number, 1 leaves it alone), motion_blur (Number 0 to 1, 0 for none), refraction (Number how far the picture is distorted, 0 for none; the underwater effect uses 0.1) and blur (Number how far the picture is blurred, 0 for none; the underwater effect uses 2.5)

Called from

Call sites

AdjustViewEffects(adjusted_view)

client plugins/screeneffects/plugin/cl_plugin.lua:470

Lets plugins change what the Screen Effects plugin adds to the view angles of the local player. Called on the client eight times a second while the player is in the game with a character, with what the headbob and the fall shake add on their own, and also when the 'headbob' effect is turned off, in which case the angles are 0. What a handler adds to or takes off an angle is kept and added every frame until the hook runs again. The angles are not added while the player is seen in third person or looks through another entity. Change the fields in place; do not return anything from the handler, or the plugins after it are not asked.

Parameters

  • view Map angles added to the view, in degrees: pitch (Number, positive looks down), yaw (Number, positive turns left) and roll (Number, positive tilts to the right)

Called from

Call sites

ShouldApplyScreenEffect(id)

client plugins/screeneffects/plugin/cl_plugin.lua:252

Asks whether one of the effects of the Screen Effects plugin should be applied to the local player. Called on the client for an effect that the server allows and the player has turned on, each time the plugin is about to apply it; that is up to once a frame per effect while the player is in the game with a character.

Parameters

  • id String effect ID: 'low_health', 'heartbeat', 'underwater' or 'headbob'

Returns

  • Boolean Return false to suppress the effect; return nothing to let the other handlers decide

Called from

Call sites

Defined in