Env shake: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(updates)
Line 1: Line 1:
{{base point|env_shake|sprite=1}} It controls screen shakes on players.
{{lang|Env shake}}
With this entity can simulates tremors (earthquakes, blast waves, passing vehicles).
{{base point|env_shake|sprite=1}} It shakes the screens of players. Objects can be jostled as well.


{{in code|class=class_c_env_shake.html CEnvShake|file=_env_shake_8cpp-source.html EnvShake.cpp}}
{{note|This can greatly hinder the accuracy of shots fired when the shaking is continuous.}}


{{clr}}
{{note|In code, a comment says that {{ent|UTIL_ScreenShake}} does not work on airborne players. This is false.}}


== Keyvalues ==
{{code class|CEnvShake|EnvShake.cpp}}
{{KV|Amplitude (0-16)|float|The amount of noise in the screen shake. Should be a range between 0 and 16.}}
{{KV|Effect Radius|float|The radius around this entity in which to affect players.}}
{{KV|Duration (seconds)|float|The length of time in which to shake the player's screens.}}
{{KV|Frequency|float|The frequency used to apply the screen shake. Should be a value between 0 and 255, where 0.1 {{=}} jerk, and 255.0 {{=}} rumble.}}
{{KV Targetname}}
{{KV Parentname}}


== Flags ==
==Flags==
* 1 : GlobalShake
*1: GlobalShake - Ignore radius, EVERYTHING shakes.
* 4 : In Air
*4: In Air - Shake players in air.
* 8 : Physics
*8: Physics - Shake physics objects, not just the camera.
* 16 : Ropes
*16: Ropes - Shake ropes. (Works independently from ''Physics''.)
* 32 : DON'T shake view (for shaking ropes or physics only)
*32: DON'T shake view (for shaking ropes or physics only)
* 64 : DON'T Rumble Controller
*64: DON'T Rumble Controller - Do not shake the controller for players using an Xbox controller, etc.


== Inputs ==
==Keyvalues==
{{IO|Amplitude|Set the amplitude (0-16)|param=string}}
{{KV|Amplitude (0-16) (amplitude)|float|How far away from the normal position the camera will wobble. Should be a range between 0 and 16.}}
{{IO|Frequency|Set the frequence. Should be a value between 0 and 255, where 0.1 {{=}} jerk, and 255.0 {{=}} rumble.|param=string}}
{{KV|Effect Radius (radius)|float|The radius around this entity in which to affect players.}}
{{KV|Duration (seconds) (duration)|float|The length of time in which to shake the player's screens.}}
{{KV|Frequency (frequency)|float|How many times per second to change the direction of the camera wobble. 40 is generally enough; values higher are hardly distinguishable.}}
{{KV BaseEntity|css=1}}
 
==Inputs==
{{IO|Amplitude|param=int|Sets '''Amplitude'''.}}
{{IO|Frequency|param=int|Sets '''Frequency'''.}}
{{IO|StartShake|Start the shake.}}
{{IO|StartShake|Start the shake.}}
{{IO|StopShake|Stop the shake.}}
{{IO|StopShake|Stop the shake.}}
{{I Targetname}}
{{I BaseEntity}}
{{I Parentname}}


== Outputs ==
==Outputs==
{{O Targetname}}
{{O BaseEntity|l4d=1}}


[[Category:GUI Entities]]
[[Category:GUI Entities]]
[[Category:Camera]]

Revision as of 19:14, 30 September 2018

English (en)中文 (zh)Translate (Translate)

Template:Base point It shakes the screens of players. Objects can be jostled as well.

Note.pngNote:This can greatly hinder the accuracy of shots fired when the shaking is continuous.
Note.pngNote:In code, a comment says that UTIL_ScreenShake does not work on airborne players. This is false.
C++ In code, it is represented by theCEnvShakeclass, defined in theEnvShake.cppfile.

Flags

  • 1: GlobalShake - Ignore radius, EVERYTHING shakes.
  • 4: In Air - Shake players in air.
  • 8: Physics - Shake physics objects, not just the camera.
  • 16: Ropes - Shake ropes. (Works independently from Physics.)
  • 32: DON'T shake view (for shaking ropes or physics only)
  • 64: DON'T Rumble Controller - Do not shake the controller for players using an Xbox controller, etc.

Keyvalues

Amplitude (0-16) (amplitude) ([todo internal name (i)]) <float>
How far away from the normal position the camera will wobble. Should be a range between 0 and 16.
Effect Radius (radius) ([todo internal name (i)]) <float>
The radius around this entity in which to affect players.
Duration (seconds) (duration) ([todo internal name (i)]) <float>
The length of time in which to shake the player's screens.
Frequency (frequency) ([todo internal name (i)]) <float>
How many times per second to change the direction of the camera wobble. 40 is generally enough; values higher are hardly distinguishable.


Inputs

Amplitude <integerRedirectInput/integer>
Sets Amplitude.
Frequency <integerRedirectInput/integer>
Sets Frequency.
StartShake
Start the shake.
StopShake
Stop the shake.


Outputs