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

env_bubbles

From Valve Developer Community
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CBubbling
CBaseEntity
C++ effects.cpp
env_bubbles in game, with density set to 6 and frequency set to 2.

env_bubbles is a brush entity available in all Source Source games. It is used to create a volume in which to spawn rising bubbles. The number and frequency of bubbles can be adjusted.

env_bubbles is obviously intended for use in water, but it can be used outside of water if such an effect is desired.

Icon-Bug.pngBug:Tying a toolstrigger brush to this entity will result in the entity being rendered in-game as a raw brush of said material, unless VBSP was compiled with -nodrawtriggers. It should be set to Nodraw or Invisible instead.
Cpp.pngCode Fix:In the spawn function, set rendermode to kRenderTransTexture (2) like its GoldSrc counterpart, or better yet, set EF_NODRAW. The bubbles themselves are sent to clients using temporary entities, so they will still be rendered.
Note.pngNote:Used bubble sprite: sprites/bubble.vmt
Note.pngNote:In order to make it work in Portal 2, the bubble sprite material (sprites/bubble.vmt) and texture (sprites/bubble.vtf) must be located in the /material/sprites folder and the TeamSpen's Hammer Addons installed, or at least its portal2.fgd located in the /Portal 2/bin folder.

Keyvalues

Name (targetname) <string>
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
Bubble density (density) <integer>
Bubble Count in Volume.
Bubble frequency (frequency) <integer>
Bubble emission frequency, in bubbles per second, values include negative numbers E.G. -10
Speed of Current (current) <float>
The speed of the water current in the volume, used to move the bubbles.

Inputs

Activate
Activates the bubbles.
Deactivate
Deactivates the bubbles.
Toggle
Toggles the bubbles on and off.
SetDensity <integerRedirectInput/integer>
Sets the bubble density.
SetFrequency <integerRedirectInput/integer>
Sets bubble emission rate in bubbles per second.
SetCurrent <integerRedirectInput/integer>
Sets current speed in inches per second.
Note.pngNote:Even though this input writes to a float, it only takes integer values.
Confirm:It might be possible to AddOutput the current (or speed) KVs, as all this input does is set the m_flSpeed variable.

Flags

Start Off : [1]

See also