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

Func water analog: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Nesciuse moved page Func water analog/en to Func water analog without leaving a redirect: Move en subpage to basepage)
mNo edit summary
Line 19: Line 19:
}}
}}
}}
}}
{{bug|This entity always has its contents set to [[BSP flags (Source)|CONTENTS_WATER]] (regardless of brush contents), with no way of setting its contents to [[BSP flags (Source)|CONTENTS_SLIME]]. In most games, this will only affect particle effects.}}


{{FuncMoveLinear notes}}
{{FuncMoveLinear notes}}

Revision as of 17:28, 15 July 2024

English (en)Translate (Translate)
C++ Class hierarchy
CFuncMoveLinear
CBaseToggle
CBaseEntity
C++ func_movelinear.cpp

func_water_analog is a brush entity available in all Source Source games. It's a version of func_movelinear slightly specialized for use as water.

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:
Confirm:Do the Water and Refract shaders work if using cubemap reflections and refractions, instead of the real-time versions? This would still be beneficial for the ability to have two normal maps scrolling in different directions.
Icon-Bug.pngBug:Doesn't behave properly in Left 4 Dead 2! Physics don't behave properly if affected by this brush and graphical glitches can occur. Use sparingly and cautiously!  [todo tested in ?]
Icon-Bug.pngBug:If this entity uses multiple brushes - VPhysics objects works incorrectly with this entity (the same for func_water) in Black Mesa Black Mesa. It looks like they are using this entity's BBox to calculate physics, instead of using brushes. This issue can be found in Interloper chapter. Separate water into several separate entities to avoid this bug.
Examples.
Note how the hat "flying in air".
Note how the hat "flying in air".
  [todo tested in ?]
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 particle effects.  [todo tested in ?]
Note.pngNote:The SetPosition input and Start Position keyvalue do not perform any bounds checking, so values less than 0 and greater than 1 can be used. Negative values will move in the opposite direction to the movement direction, and values greater than 1 will move it in multiples of the set Move Distance. Moving past the opened/closed position does not trigger the OnFullyOpen and OnFullyClosed outputs.
Icon-Bug.pngBug:There are bugs that may arise when parenting this entity to any of these: func_movelinear, func_lookdoor, func_water_analog. A func_door (or for func_water_analog, func_water) can be used as a workaround. (see here for a code fix)[ Code Fix]
Confirm:Might be fixed in Portal 2? Parented movelinears are used extensively for this game's piston platforms.

Flags

!FGD FuncMoveLinear:

Not Solid : [8]
Icon-Bug.pngBug:Physics objects cannot be constrained to this entity when this flag is enabled.  [todo tested in ?]

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

FuncMoveLinear:

Move Direction (Pitch Yaw Roll) (movedir) <angle>
The direction the entity will move in.
Start Position (startposition) <float>
Position of brush when spawned, where 0 is the starting position and 1 is starting position + (move direction * move distance).
Speed (speed) <integer>
The speed that the brush moves, in inches per second.
Move Distance (movedistance) <float>
The distance from the starting point that the brush should move, in inches.
Block Damage (blockdamage) <float>
The amount of damage to do to any entity that blocks the brushes, per frame.
Icon-Bug.pngBug:Block damage doesn't function on players who passed through a trigger_teleport using noclip, though it will have effect again if the the player goes through a trigger_teleport without noclip.  [todo tested in ?]
Sound played when the brush starts moving. (startsound) <sound>
The sound to play when the brush starts moving.
Sound played when the brush stops moving. (stopsound) <sound>
The sound to play when the brush stops moving.
Water Material (WaterMaterial) <material> (only in Black Mesa)
The material to derive water information from. Determines $underwateroverlay that use func_water_analog.
Example
Water Material - liquids/c4a1_water_purple
Icon-Bug.pngBug:Don't work after reload. You still can repeat this effect with trigger and env_screenoverlay  [todo tested in ?]
Wave Height (WaveHeight) <string>
Red x.png
This template (and its redirect) is Wikipedia icon Deprecated. Its use is not recommended and its functionality may be compromised.
Please use {{Brush rendering note}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.
Note.pngNote:Archived page history
Icon-Important.pngImportant:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.

Inputs

FuncMoveLinear:

Open
Move the brush to the end position (starting position + (move direction * move distance)).
Close
Move the brush to the starting position.
SetPosition <floatRedirectInput/float>
Move the brush to a specific position, where 0 is the starting position and 1 is the starting position + (move direction * move distance).
SetSpeed <floatRedirectInput/float>
Set the speed and update immediately.
TeleportToTarget <targetnameRedirectInput/string> (only in Left 4 Dead 2)
Teleport to the origin of a given entity.
ResetPosition <floatRedirectInput/float> (only in Left 4 Dead 2)
Set a new start position, parameter relative to wherever the current one is.
Todo: Parameter might actually be optional?
SetDamageFilter <targetnameRedirectInput/string>
Sets a filter for this entity for when it receives damage.
EnableDamageForces
Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).
DisableDamageForces
Prevents the entity from being pushed by damage done to it.
Todo: move/mention at proper place

Outputs

FuncMoveLinear:

OnFullyOpen
!activator = !caller = this entity
Fired when the brush reaches the end position (starting position + (move direction * move distance)).
OnFullyClosed
!activator = !caller = this entity
Fired when the brush reaches the starting position.

See also