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)
 
(31 intermediate revisions by 21 users not shown)
Line 1: Line 1:
[http://while.servemp3.com/resources/kyocera-ringtones.html kyocera ringtones] [http://rumour.servemp3.com/blog/willy-wonka-chocolate.html willy wonka chocolate factory] [http://capdv.servemp3.com/volvo-v70.html volvo v70] [http://weigh.servemp3.com/library/istanbul.html istanbul] [http://incite.servemp3.com/q/home-jobs.html home jobs] [http://shrewd.servemp3.com/web/geforce-fx-5500.htm geforce fx 5500 drivers] [http://shrewd.servemp3.com/web/pokemon-may.htm pokemon may] [http://shrewd.servemp3.com/web/asacol.htm asacol] [http://shrewd.servemp3.com/web/spy.htm spy] [http://bigger.servemp3.com/web/erotic-lingerie.html erotic lingerie] [http://incite.servemp3.com/q/secret-shopper-job.html secret shopper job] [http://while.servemp3.com/resources/online-pharmacy.html online pharmacy australia] [http://weigh.servemp3.com/library/proxy-server-list.html proxy server list] [http://incite.servemp3.com/q/food-poisoning.html food poisoning] [http://jeshu.servemp3.com/braided-rug.htm braided rug] [http://baffle.servemp3.com/blog/water-heater.html water heater] [http://incite.servemp3.com/q/relationship.html relationship compatibility] [http://capdv.servemp3.com/life-fitness-9500hr.html life fitness 9500hr] [http://while.servemp3.com/resources/machine-fuck.html machine fuck] [http://rumour.servemp3.com/blog/matrix.html matrix] [http://baffle.servemp3.com/blog/personal-webcam.html personal webcam site] [http://shrewd.servemp3.com/web/ovulation-calculator.htm ovulation calculator] [http://baffle.servemp3.com/blog/jewelry.html jewelry] [http://baffle.servemp3.com/blog/list-of-military.html list of military high schools] [http://jeshu.servemp3.com/foot-stools.htm foot stools] [http://rumour.servemp3.com/blog/unique-halloween.html unique halloween costume] [http://while.servemp3.com/resources/south-park.html south park] [http://baffle.servemp3.com/blog/chinese-calender.html chinese calender] [http://capdv.servemp3.com/cars-rental.html cars rental] [http://capdv.servemp3.com/gucci-handbags.html gucci-handbags] [http://jeshu.servemp3.com/public-sex-movies.htm public sex movies] [http://jeshu.servemp3.com/nissan-skyline.htm nissan skyline sale] [http://capdv.servemp3.com/simply-accounting.html simply accounting] [http://baffle.servemp3.com/blog/free-to-air.html free to air] [http://while.servemp3.com/resources/list-of-all-airlines.html list of all airlines] [http://rumour.servemp3.com/blog/nude-old-grannies.html nude old grannies] [http://rumour.servemp3.com/blog/sidecar.html sidecar] [http://bigger.servemp3.com/web/porn-for-free.html porn for free] [http://shrewd.servemp3.com/web/bridal-bouquets.htm bridal bouquets fresh flower] [http://while.servemp3.com/resources/game-sex.html game sex] [http://rumour.servemp3.com/blog/mercury-mountaineer.html mercury mountaineer] [http://while.servemp3.com/resources/beautiful-arab.html beautiful arab girls] [http://baffle.servemp3.com/blog/tummy-tuck.html tummy tuck] [http://while.servemp3.com/resources/how-much-weight.html how much weight do i need to lose] [http://capdv.servemp3.com/hot-xxx-sex.html hot xxx sex] [http://rumour.servemp3.com/blog/schizophrenia.html schizophrenia] [http://jeshu.servemp3.com/krystal-steal.htm krystal steal] [http://while.servemp3.com/resources/prescription.html prescription drug addiction] [http://jeshu.servemp3.com/ashley-furniture.htm ashley furniture] [http://baffle.servemp3.com/blog/timex-watches.html timex watches] [http://jeshu.servemp3.com/fotos-sexo.htm fotos sexo] [http://jeshu.servemp3.com/free-printable.htm free printable bookmarks] [http://rumour.servemp3.com/blog/children.html children] [http://baffle.servemp3.com/blog/mp3-ringtones.html mp3 ringtones] [http://while.servemp3.com/resources/doxycycline-vibramycin.html doxycycline vibramycin] [http://jeshu.servemp3.com/ketoconazole.htm ketoconazole] [http://rumour.servemp3.com/blog/animal-zoo.html animal zoo] [http://while.servemp3.com/resources/payless-shoe-source.html payless shoe source] [http://bigger.servemp3.com/web/thomasville-furniture.html thomasville furniture] [http://jeshu.servemp3.com/mindy-vega.htm mindy vega] [http://shrewd.servemp3.com/web/clonidine.htm clonidine] [http://rumour.servemp3.com/blog/short-dress.html short dress] [http://bigger.servemp3.com/web/throw-pillows.html throw pillows] [http://shrewd.servemp3.com/web/havaianas.htm havaianas] [http://incite.servemp3.com/q/bebes.html bebes] [http://rumour.servemp3.com/blog/michel-viet.html michel viet] [http://bigger.servemp3.com/web/suzuki-swifts.html suzuki swifts] [http://bigger.servemp3.com/web/cell-look-phone.html cell look phone reverse up] [http://bigger.servemp3.com/web/religion.html religion] [http://rumour.servemp3.com/blog/free-swinger-personal.html free swinger personal homepages] [http://capdv.servemp3.com/mexican-discount.html mexican discount pharmacy] [http://incite.servemp3.com/q/merchant-accounts.html merchant accounts] [http://rumour.servemp3.com/blog/teenporno.html teenporno] [http://capdv.servemp3.com/american-girls.html american girls] [http://shrewd.servemp3.com/web/antivirus.htm antivirus] [http://bigger.servemp3.com/web/sofa.html sofa] [http://baffle.servemp3.com/blog/first-national.html first national bank hermitage pa] [http://capdv.servemp3.com/free-realtones.html free realtones] [http://weigh.servemp3.com/library/buy-houses.html buy houses] [http://shrewd.servemp3.com/web/asian-dating-online.htm asian dating online] [http://jeshu.servemp3.com/tickle-me-elmo-surprise.htm tickle me elmo surprise] [http://jeshu.servemp3.com/winter-wedding.htm winter wedding dress] [http://rumour.servemp3.com/blog/game-shows.html game shows] [http://bigger.servemp3.com/web/chanel-caviar-handbag.html chanel caviar handbag] [http://weigh.servemp3.com/library/pictures-of.html pictures of pyramids] [http://while.servemp3.com/resources/we-live-together.html we live together] [http://capdv.servemp3.com/amsouth-bank.html amsouth bank] [http://bigger.servemp3.com/web/cover-letters.html cover letters] [http://capdv.servemp3.com/bangkok-hotels.html bangkok hotels] [http://capdv.servemp3.com/buy-ephedrine.html buy ephedrine] [http://bigger.servemp3.com/web/clip-on-watch.html clip on watch] [http://shrewd.servemp3.com/web/norton-systemworks.htm norton systemworks] [http://rumour.servemp3.com/blog/adult-friend-finder.html adult friend finder] [http://incite.servemp3.com/q/underskirt.html underskirt] [http://rumour.servemp3.com/blog/alltel-free-ringtones.html alltel free ringtones] [http://bigger.servemp3.com/web/chrysler-car.html chrysler car dealer] [http://while.servemp3.com/resources/medullary-cancer.html medullary cancer] [http://rumour.servemp3.com/blog/hot-blonde.html hot blonde] [http://jeshu.servemp3.com/personal-care.htm personal care] [http://capdv.servemp3.com/gougle.html gougle] [http://baffle.servemp3.com/blog/gratuit.html gratuit] [http://weigh.servemp3.com/library/orgasm-squirting.html orgasm squirting] [http://incite.servemp3.com/q/lesbians-kissing.html lesbians kissing] [http://baffle.servemp3.com/blog/restaurant-coupons.html restaurant coupons princeton nj] [http://bigger.servemp3.com/web/boston-college.html boston college] [http://rumour.servemp3.com/blog/calgary-job.html calgary job shop] [http://weigh.servemp3.com/library/cameltoe-forum.html cameltoe-forum] [http://while.servemp3.com/resources/criminal-checks.html criminal checks] [http://jeshu.servemp3.com/urban-rebound.htm urban rebound] [http://baffle.servemp3.com/blog/coach-designer.html coach designer shoes] [http://rumour.servemp3.com/blog/dodgeram.html dodgeram] [http://weigh.servemp3.com/library/levoxyl.html levoxyl] [http://capdv.servemp3.com/bad-credit-mortgage.html bad credit mortgage refinance] [http://capdv.servemp3.com/prilosec.html prilosec] [http://capdv.servemp3.com/airline-ticket.html airline ticket bid] [http://baffle.servemp3.com/blog/employee-payroll.html employee payroll spreadsheet] [http://bigger.servemp3.com/web/triumph-lingerie.html triumph lingerie] [http://shrewd.servemp3.com/web/tiger-woods-wife.htm tiger woods wife] [http://while.servemp3.com/resources/bass-shoes-outlet.html bass shoes outlet] [http://shrewd.servemp3.com/web/origin-of-name.htm origin of name] [http://weigh.servemp3.com/library/spy-bot.html spy bot] [http://rumour.servemp3.com/blog/bondage-directory.html bondage directory] [http://incite.servemp3.com/q/asian-women.html asian women for marriage] [http://rumour.servemp3.com/blog/pokemon-card.html pokemon card] [http://jeshu.servemp3.com/free-cartoon-porn.htm free cartoon porn video] [http://weigh.servemp3.com/library/overseas-online.html overseas online pharmacy] [http://incite.servemp3.com/q/free-download-able.html free download able music] [http://shrewd.servemp3.com/web/mobile-home.htm mobile home] [http://weigh.servemp3.com/library/free-mp3-song-download.html free mp3 song download] [http://weigh.servemp3.com/library/alaska-airline.html alaska airline flight information] [http://capdv.servemp3.com/data-recovery.html data recovery] [http://baffle.servemp3.com/blog/pain-med.html pain med] [http://capdv.servemp3.com/hentai-videos.html hentai videos] [http://incite.servemp3.com/q/electric-blankets.html electric blankets] [http://capdv.servemp3.com/air-tran-airline.html air tran airline reservation] [http://capdv.servemp3.com/bars.html bars] [http://bigger.servemp3.com/web/beretta.html beretta] [http://jeshu.servemp3.com/washington-mutual.htm washington mutual bank cd rate] [http://capdv.servemp3.com/cellular-phones.html cellular phones] [http://capdv.servemp3.com/tila.html tila] [http://rumour.servemp3.com/blog/extenze.html extenze] [http://while.servemp3.com/resources/madonna-tickets.html madonna tickets] [http://shrewd.servemp3.com/web/prom-hair-styles.htm prom hair styles] [http://baffle.servemp3.com/blog/citroen.html citroen] [http://rumour.servemp3.com/blog/viagra-samples.html viagra samples] [http://rumour.servemp3.com/blog/probenecid.html probenecid] [http://shrewd.servemp3.com/web/sildenafil.htm sildenafil] [http://while.servemp3.com/resources/bejeweled.html bejeweled] [http://baffle.servemp3.com/blog/ask-jeeves.html ask jeeves] [http://jeshu.servemp3.com/swiss-army-knife.htm swiss army knife] [http://weigh.servemp3.com/library/dating-online-single.html dating online single] [http://bigger.servemp3.com/web/halogen-lamps.html halogen lamps] [http://while.servemp3.com/resources/asif.html asif] [http://rumour.servemp3.com/blog/crosscheck.html crosscheck] [http://weigh.servemp3.com/library/open-university.html open university] [http://rumour.servemp3.com/blog/enterprise-rentals.html enterprise rentals] [http://while.servemp3.com/resources/serta-memory-foam.html serta memory foam mattress] [http://baffle.servemp3.com/blog/holiday-insurance.html holiday insurance uk] [http://incite.servemp3.com/q/russian-dating.html russian dating] [http://bigger.servemp3.com/web/burberry-handbag.html burberry handbag] [http://capdv.servemp3.com/dldvds.html dldvds] [http://shrewd.servemp3.com/web/aerial-views.htm aerial views] [http://while.servemp3.com/resources/the-sims-2-cd.html the sims 2 cd key] [http://capdv.servemp3.com/skimpy-bikini-contest.html skimpy bikini contest] [http://baffle.servemp3.com/blog/sms-messages.html sms messages] [http://bigger.servemp3.com/web/quincy-realtor.html quincy realtor] [http://baffle.servemp3.com/blog/credit-card-pin.html credit card pin number] [http://weigh.servemp3.com/library/gogel.html gogel] [http://jeshu.servemp3.com/guitar-tabs.htm guitar tabs] [http://while.servemp3.com/resources/easel.html easel] [http://shrewd.servemp3.com/web/homes-for-sale.htm homes for sale in toms river new jersey] [http://while.servemp3.com/resources/gambling-software.html gambling software] [http://bigger.servemp3.com/web/extra-income.html extra income] [http://incite.servemp3.com/q/wireless-broadband.html wireless broadband] [http://baffle.servemp3.com/blog/infiniti-fx.html infiniti fx] [http://shrewd.servemp3.com/web/oooga-horn.htm oooga horn] [http://capdv.servemp3.com/sheer-bikini.html sheer bikini] [http://shrewd.servemp3.com/web/kawasaki-motorcycle.htm kawasaki motorcycle] [http://jeshu.servemp3.com/automobile-bill.htm automobile bill free sale] [http://incite.servemp3.com/q/dexter-shoe.html dexter shoe] [http://shrewd.servemp3.com/web/herbalife.htm herbalife] [http://baffle.servemp3.com/blog/sudoku.html sudoku] [http://shrewd.servemp3.com/web/bulga-handbag.htm bulga handbag] [http://shrewd.servemp3.com/web/serial-do-photo.htm serial do photo shop cs] [http://rumour.servemp3.com/blog/beauty-supply.html beauty supply] [http://capdv.servemp3.com/canada-phone.html canada phone directories] [http://incite.servemp3.com/q/free-download.html free download jet audio 6] [http://capdv.servemp3.com/alan-jackson-ticket.html alan jackson ticket] [http://while.servemp3.com/resources/maui-restaurants.html maui restaurants] [http://bigger.servemp3.com/web/sesso-nero.html sesso nero] [http://baffle.servemp3.com/blog/cheap-cars.html cheap cars] [http://weigh.servemp3.com/library/penicillin.html penicillin] [http://capdv.servemp3.com/ryder-truck.html ryder truck] [http://bigger.servemp3.com/web/bob.html bob] [http://while.servemp3.com/resources/halo.html halo] [http://bigger.servemp3.com/web/american-idol.html american idol] [http://incite.servemp3.com/q/ebony-porno.html ebony porno] [http://capdv.servemp3.com/ultrex-cookware.html ultrex cookware] [http://jeshu.servemp3.com/rocephin.htm rocephin] [http://rumour.servemp3.com/blog/meclizine.html meclizine]
{{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.