This article's documentation is for anything that uses the Source engine. Click here for more information.

Env shake: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(START_SHAKE_NORUMBLE seems to be broken in src 13 +, maybe even on older branches)
 
(35 intermediate revisions by 24 users not shown)
Line 1: Line 1:
[http://www.hdac.org/hdfaq/faq/kjrgvh.html premium finance life insurance plans] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/fffjpd.html trans asia shipping line] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/pfetai.html 16 year old german models] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/qxforv.html lyrics time of your life by green day] [http://smallbizbohol.com/democatalog/images/baner/mrfoxm.html wedding furniture rental] [http://roycemotor.com/carpics/cache/uibesi.html taylor building crystal city virginia] [http://panties-pictures.com/free/lib/temp/hfumpl.html wyoming new home] [http://hoosierfishing.com/phpBB/images/avatars/avatar/fwfmgq.html virginia hunting and fishing] [http://panties-pictures.com/free/lib/temp/bibrps.html personal property law] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/kcflnf.html and 1mixtape tour] [http://www.hdac.org/hdfaq/faq/jldwxq.html play free car racing game now] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/ggfign.html nys bankruptcy law] [http://ankelia-nature.com/catalogues/catalogues/temlsg.html engine marketing search travel] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/mttedp.html peroxisome proliferation] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/cuspeh.html american express corporate travel sydney] [http://asie-voyages.com/upload/images/lens/fwwrrv.html avi video editing software] [http://www.youthfitnesssolutions.com/FTP1/page9/lppfwd.html summer springs] [http://smallbizbohol.com/democatalog/images/baner/fxsokv.html zebra information for children] [http://hoosierfishing.com/phpBB/images/avatars/avatar/tnufdi.html air products retirement and savings plan] [http://smallbizbohol.com/democatalog/images/baner/ispxlf.html stamp collecting company] [http://tch-voyages.com/documents/prague/896/veuohp.html martin luther kings jr. death] [http://www.lewakins.com/sr/images/emxokd.html kilkenny design center] [http://tch-voyages.com/documents/prague/896/snnfpt.html south african police clearance certificate] [http://xuccco.org/themes/AT-Green3/kvepoa.html print yourself wedding invitation] [http://roycemotor.com/carpics/cache/vppqij.html western blvd] [http://tch-voyages.com/documents/prague/896/tuidso.html what food do japanese eat] [http://tarsierfoundation.org/content/license/gxqbte.html personal property law] [http://panties-pictures.com/free/lib/temp/irfchu.html within temptation music videos] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/ghrqes.html elevator co ltd] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/bpgpwt.html ticket charge outlets] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/ipfwii.html machinist employment] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/sgaxas.html pay as you go camera phones] [http://panties-pictures.com/free/lib/temp/juudxe.html microsoft office professional 2003 full] [http://indianaoutfitters.com/s/info/tmp/xnoshb.html when to have intercourse to get pregnant] [http://asie-voyages.com/upload/images/lens/wbpjau.html nascar baby toys] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/qdnhnp.html toyota dealer in arizona] [http://xuccco.org/themes/AT-Green3/xciunt.html am logo pan] [http://www.biblored.org.co/agenda_actividades/programas/images/jxcqkh.html exclusive lead mortgage non] [http://smallbizbohol.com/democatalog/images/baner/rckvpe.html korean wong] [http://panties-pictures.com/free/lib/temp/fmjedp.html pacific trading card] [http://coastguard.gov.ph/content.old/license/oneaks.html account bank international number] [http://roycemotor.com/carpics/cache/orhejh.html area wilderness] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/jsptio.html local radar texas weather] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/ufmdui.html arizona building contractors] [http://www.hdac.org/hdfaq/faq/plsrii.html love actually script free] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/wcspbj.html resell computer] [http://panties-pictures.com/free/lib/temp/obkfwx.html apartment search web site] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/kdvrcx.html estate loan loan mortgage r real] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/uuedil.html phillies logo] [http://www.hdac.org/hdfaq/faq/bhofkc.html miami dade housing] [http://www.youthfitnesssolutions.com/FTP1/page9/ltwogh.html 1984 george orwell pictures] [http://asie-voyages.com/upload/images/lens/xdstjg.html injury in hockey] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/cqaifh.html sounds free] [http://www.youthfitnesssolutions.com/FTP1/page9/tvfwqm.html platform building materials] [http://asie-voyages.com/upload/images/lens/smtdvu.html walking around] [http://coastguard.gov.ph/content.old/license/roqixj.html south bend in movie times] [http://www.youthfitnesssolutions.com/FTP1/page9/avaqin.html journal teaching exceptional children] [http://www.norcab.com.au/joeavatiforum/templates/cache/nmuwmi.html pictures of tattoos on top of feet] [http://tch-voyages.com/documents/prague/896/bfedes.html area bay day event memorial weekend] [http://ankelia-nature.com/catalogues/catalogues/fictgi.html west park village] [http://hoosierfishing.com/phpBB/images/avatars/avatar/vhklgd.html mercedes benz head light] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/dnxvks.html new lights old lights] [http://coastguard.gov.ph/content.old/license/hsutne.html tmobile cell phone deals] [http://tch-voyages.com/documents/prague/896/pruosc.html lego location store] [http://smallbizbohol.com/democatalog/images/baner/vxaecv.html the used blue and yellow] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/qletdm.html litchfield il] [http://talentmodeles.com/mannequin/images/cache/eotdsl.html local and long distance] [http://ankelia-nature.com/catalogues/catalogues/jmmhpx.html wba champions] [http://www.norcab.com.au/joeavatiforum/templates/cache/xrhilv.html virtual reality software company] [http://lumayagrealty.com/catalog/images/pics/gbauqr.html view earth from space] [http://tch-voyages.com/documents/prague/896/rocnjo.html india australia] [http://roycemotor.com/carpics/cache/krutqk.html 2nd commercial lender mortgage] [http://ankelia-nature.com/catalogues/catalogues/pkreat.html performance advantage company] [http://smallbizbohol.com/democatalog/images/baner/aqpkeh.html rebound 2005] [http://indianaoutfitters.com/s/info/tmp/upvnfv.html about blank virus fix] [http://talentmodeles.com/mannequin/images/cache/djpbkp.html stewart patterson] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/hbnfrw.html always turned on] [http://coastguard.gov.ph/content.old/license/hlnpvg.html mental health association nyc] [http://asie-voyages.com/upload/images/lens/buoiht.html ac cars homepage] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/vrmdcn.html kaos design] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/fbtkdh.html kursplan] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/nlucto.html play paintball video games online] [http://panties-pictures.com/free/lib/temp/vgbgdi.html msc uk ltd] [http://hoosierfishing.com/phpBB/images/avatars/avatar/hjgwhx.html my words be few lyrics] [http://www.biblored.org.co/agenda_actividades/programas/images/vbloak.html ranch management software] [http://roycemotor.com/carpics/cache/phabkh.html small talk is] [http://smallbizbohol.com/democatalog/images/baner/hmequv.html woman online magazine] [http://www.lewakins.com/sr/images/msdxcj.html infiniti suv 2003] [http://smallbizbohol.com/democatalog/images/baner/ubpixm.html rabbit posters] [http://indianaoutfitters.com/s/info/tmp/erwujv.html widespread panic shows] [http://hoosierfishing.com/phpBB/images/avatars/avatar/xeeqfd.html measure for measure reviews] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/wihaek.html intimate apparel review] [http://xuccco.org/themes/AT-Green3/vkdurf.html kid listen time] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/bujnns.html string orchestras] [http://xuccco.org/themes/AT-Green3/xrhfuv.html picture quizzes free] [http://www.norcab.com.au/joeavatiforum/templates/cache/futrij.html properties for rent in spain] [http://www.biblored.org.co/agenda_actividades/programas/images/weiaxa.html unity marketing] [http://coastguard.gov.ph/content.old/license/chjpml.html walking exercise dvd] [http://indianaoutfitters.com/s/info/tmp/nbgvfo.html true colors tabs] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/phdlla.html express bus fare hike]
{{LanguageBar}}
{{wrongtitle|title=env_shake}}
{{TabsBar|main=gs|base=env_shake}}
{{Underlinked|date=January 2024}}
{{CD|CEnvShake|file1=EnvShake.cpp}}
{{This is a|point entity|name=env_shake|sprite=1}} When it receives the input <code>StartShake</code>, it shakes the screens of [[player]]s for some duration. Objects can be jostled as well.


== Entity description ==
{{tip|To get a continuous shake, one can fire the <code>StartShake</code> input at regular intervals, for example using a [[logic_timer]]. The continuous shake can then be stopped by disabling the timer.}}
[[Image:{{PAGENAME}}.png|left]]An entity to control screen shake on players.{{clr}}


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


== Keyvalues ==
{{note|In code, a comment says that {{ent|UTIL_ScreenShake}} does not work on airborne players. This is false.}}
*{{kv targetname}}
*{{kv parentname}}
*'''amplitude'''
:<float> The amount of noise in the screen shake. Should be a range between 0 and 16.
*'''radius'''
:<float> The radius around this entity in which to affect players.
*'''duration'''
:<float> The length of time in which to shake the player's screens.
*'''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.


== Flags ==
__NOTOC__
*1 : Shake everywhere
==Flags==
*4 : In Air
{{fl|1|GlobalShake|Ignore radius, EVERYTHING shakes.}}
: Shakes objects even if they are not on the ground
{{fl|4|In Air|Shake players even if they are in mid-air. Normally, if <code>StartShake</code> is fired while a player is in mid-air, they don't get any shaking at all even if they land before the shaking would end.}}
*8 : Physics
{{fl|8|Physics|Shake physics objects, not just the camera.}}
: Shakes physics
{{fl|16|Ropes|Shake ropes. This works independently from '''Physics'''.}}
*16 : Ropes
{{fl|32|DON'T shake view (for shaking ropes or physics only)}}
: Shakes ropes
{{fl|64|DON'T Rumble Controller|Do not shake the controller for players using an Xbox controller, etc.{{bug*|This flag disables the shake entirely.}}}}
*{{ep1 add|32 : No view}}
: Don't shake view


== Inputs ==
==Keyvalues==
*{{i targetname}}
{{KV Targetname}}
*{{i parentname}}
{{KV|Amplitude (0-16)|intn=amplitude|float|How far away from the normal position the camera will wobble and objects move. For camera, should be a range between 0 and 16. For objects, can be set much higher. {{note|With high amplitudes, the player might be able to briefly look through walls that they touch.}}}}
*'''Amplitude <float>'''
{{KV|Effect Radius|intn=radius|float|The radius around this entity in which to affect players. {{note|Players within the effect radius will be affected by the shaking for the set duration, regardless of whether they remain within the radius after the shaking begins. Also, <code>StopShake</code> will only stop any shaking for players within the radius.}}}}
:Set the amplitude (0-16)
{{KV|Duration (seconds)|intn=duration|float|The length of time in which to shake the player's screens.}}
*'''Frequency <float>'''
{{KV|Frequency|intn=frequency|float|How many times per second to change the direction of the camera wobble. 40 is generally enough; values higher are hardly distinguishable.}}
:Set the frequency. Should be a value between 0 and 255, where 0.1 = jerk, and 255.0 = rumble.
*'''StartShake'''
:Start the shake.
*'''StopShake'''
:Stop the shake.


== Outputs ==
*{{o targetname}}


[[Category:Entities]]
==Inputs==
[[Category:Camera]]
{{I|Amplitude|param=int|Sets '''Amplitude'''.}}
{{I|Frequency|param=int|Sets '''Frequency'''.}}
{{I|StartShake|Start the shake. If a radius is used, it affects only players inside it and the shake amplitude for a player depends on their distance to the shake entity. Multiple shake starts at once do add up.}}
{{I|StopShake|Stop the shake. If a radius is used, it affects only players inside it.}}
 
[[Category:GUI Entities]]

Latest revision as of 21:22, 5 September 2025

English (en)中文 (zh)Translate (Translate)
Underlinked - Logo.png
This article needs more Wikipedia icon links to other articles to help Wikipedia icon integrate it into the encyclopedia. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
C++ Class hierarchy
CEnvShake
CPointEntity
CBaseEntity
C++ EnvShake.cpp
Env shake.png

env_shake is a point entity available in all Source Source games. When it receives the input StartShake, it shakes the screens of players for some duration. Objects can be jostled as well.

Tip.pngTip:To get a continuous shake, one can fire the StartShake input at regular intervals, for example using a logic_timer. The continuous shake can then be stopped by disabling the timer.
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.


Flags

GlobalShake : [1]
Ignore radius, EVERYTHING shakes.
In Air : [4]
Shake players even if they are in mid-air. Normally, if StartShake is fired while a player is in mid-air, they don't get any shaking at all even if they land before the shaking would end.
Physics : [8]
Shake physics objects, not just the camera.
Ropes : [16]
Shake ropes. This works independently from Physics.
DON'T shake view (for shaking ropes or physics only) : [32]
DON'T Rumble Controller : [64]
Do not shake the controller for players using an Xbox controller, etc.
Icon-Bug.pngBug*:This flag disables the shake entirely.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Amplitude (0-16) (amplitude) <float>
How far away from the normal position the camera will wobble and objects move. For camera, should be a range between 0 and 16. For objects, can be set much higher.
Note.pngNote:With high amplitudes, the player might be able to briefly look through walls that they touch.
Effect Radius (radius) <float>
The radius around this entity in which to affect players.
Note.pngNote:Players within the effect radius will be affected by the shaking for the set duration, regardless of whether they remain within the radius after the shaking begins. Also, StopShake will only stop any shaking for players within the radius.
Duration (seconds) (duration) <float>
The length of time in which to shake the player's screens.
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.


Inputs

Amplitude <integerRedirectInput/integer>
Sets Amplitude.
Frequency <integerRedirectInput/integer>
Sets Frequency.
StartShake
Start the shake. If a radius is used, it affects only players inside it and the shake amplitude for a player depends on their distance to the shake entity. Multiple shake starts at once do add up.
StopShake
Stop the shake. If a radius is used, it affects only players inside it.