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

func_water

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)
edit
Class hierarchy
CBaseDoor
CBaseToggle
CBaseEntity
doors.cpp
Info.png
This entity is not in the FGD by default.
See below for instructions on making it available.
Obsolete-notext.png
This entity is Obsolete. Its use is discouraged, and it may only exist/function in older engine branches.
It has since been replaced by func_water_analog. Non-moving water brushes should be part of worldspawn.

func_water is a brush entity available in all Source Source games. Legacy entity from the GoldSrc GoldSrc engine, deprecated by func_water_analog. It is still used in some Half-Life: Source Half-Life: Source maps.

Icon-Important.pngImportant:Does not work with materials using real time reflections and/or refractions, as seen in Water and Refract.
Use a material which uses a regular brush shader, such as:
Icon-Bug.pngBug:This entity always has its contents set to CONTENTS_WATER (regardless of brush contents), with no way of setting its contents to CONTENTS_SLIME. In most games, this will only affect splash particles.
Cpp.pngCode Fix:Add a KV that is read by CBaseDoor::CreateVPhysics to set fluid.contents (defaulting to CONTENTS_WATER if KV is absent)
  (tested in: SDK 2013 source code)
Cpp.pngCode:Both func_water and func_door are linked to CBaseDoor C++ class. The game code checks the classname KV to distinguish between them, applying specific behaviors if the classname is "func_water". As such, using AddOutput to change the classname of a func_water may have unexpected effects.

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

Move Direction (Pitch Yaw Roll) (movedir) <angle>
The direction the water will move when it is told to 'Open'. Default value is "0 0 0".
Wave Height (WaveHeight) <string> Obsolete
Deprecated.
Default value is 3.0. No effect on stock shaders, as GoldSrc-style waves were removed in Retail Half-Life 2 (only existing in the leaked "beta").

BaseDoor:

Linked Door (chainstodoor) <targetname> !FGD
Passes the door's +use inputs and touch events onto a different door, so it also is activated.
Block Filter Name (filtername) <targetname>
(For Half-Life: Source) Filter to use to determine entities that can block the door.
Speed (speed) <float>
Speed that the door moves, in units (sliding door) or degrees (rotating door) per second.
Start Sound (noise1) <sound>
Sound to play when the door starts opening. Also plays when door starts closing if startclosesound is absent.
Stop Sound (noise2) <sound>
Sound to play when the door stops opening. Also plays when door stops closing if closesound is absent.
Start Close Sound (startclosesound) <sound>
Sound to play when the door starts closing.
Stop Close Sound (closesound) <sound>
Sound to play when the door stops closing.
Delay Before Reset (wait) <float>
Time until the door returns to the closed position. A value of -1 means the door never auto-closes.
Lip (lip) <float>
When the door opens, it will move its full length minus this many units. Negative values will make the door move that many more than its length.
Blocking Damage (dmg) <float>
Amount of damage done to entities that block the movement of this door, per frame.
Icon-Bug.pngBug:Normally a door will damage things blocking it, however if the player is teleported by a trigger_teleport while using noclip, they will not be damaged.  [todo tested in?]
Force Closed (forceclosed) <boolean>
Makes the door close no matter what. Useful for doors that have to close even if the player tries to block them with objects.
Ignore Debris (ignoredebris) <boolean>
Changes the door's collision group to COLLISION_GROUP_INTERACTIVE, which ignores debris objects. Not compatible with the Non-solid to Player spawnflag as it also sets a collision group.
Health (shoot open) (health) <integer> Obsolete
Deprecated.
In Quake Quake and GoldSrc GoldSrc, if this was set, the door would open when it took this much damage. Nonfunctional in most Source Source games; can be emulated by parenting an invisible func_button with spawnflag 512 set, and having the button target this door.
Message If Triggered (message) <string> Obsolete
Deprecated.
In Quake Quake and GoldSrc GoldSrc, if this was set, a message would appear on the the player's hud when the door is locked and they attempt to open the door. Nonfunctional in most Source Source games; can be emulated by calling an env_message with the door's OnLockedUse output.
Locked Sound (locked_sound) <sound>
Sound played when the player tries to open the door, and fails because it's locked.
Unlocked Sound (unlocked_sound) <sound>
Sound played when door is unlocked.
Spawn Position (spawnpos) <choices>
State the door should begin in.
  • 0: Closed
  • 1: Open
Locked Sentence (locked_sentence) <choices> (only in Half-Life: Source Half-Life Deathmatch: Source)
Intercom voiceline for when the player tries to use the door, but it's locked.
Unlocked Sentence (unlocked_sentence) <choices> (only in Half-Life: Source Half-Life Deathmatch: Source)
Intercom voiceline for when the door is unlocked.
Loop Moving Sound? (loopmovesound) <boolean>
Makes the door's Start Sound loop until the door finishes moving.
Icon-Bug.pngBug:If an already-looping sound is played with this enabled, it can continue forever. Further attempts to open or close the door will only add another looping sample to the noise.  [todo tested in?]

Flags

"Starts Open" : [1]
"Use Only" : [256]

Inputs

Door:

Open
Opens door.
Close
Closes door.
Toggle
Opens door if closed, closes door if opened.
Lock
Prevent door from opening, but can still close.
Unlock
Allow door to operate as normal.
SetSpeed <float>
Sets Speed.

Outputs

BaseDoor:

OnClose
Fired when the door starts to close.
OnOpen
Fired when the door starts to open.
OnFullyClosed
Fired when the door finishes closing. Reversed if Start Open flag is set.
OnFullyOpen
Fired when the door finishes opening. Reversed if Start Open flag is set.
OnBlockedClosing
Fired when the door has been blocked from closing. !activator is whatever blocks the door.
OnBlockedOpening
Fired when the door has been blocked from opening. !activator is whatever blocks the door.
OnUnblockedClosing
Fired when the door is no longer blocked from closing.
OnUnblockedOpening
Fired when the door is no longer blocked from opening.
OnLockedUse
Fired when the player tries to open the door but fails because it is locked.