Func water analog: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Removing Russian youtube advertising.)
(updates)
Line 1: Line 1:
{{base brush|func_water_analog}}
{{lang|Func water analog}}
{{base brush|func_water_analog}} It's a version of {{ent|func_movelinear}} slightly specialized for use as water.


==Entity description==
Only two [[material]]s are known to render correctly across all systems, these are <code>nature/water_movingplane</code> and <code>nature/water_dx70</code>. [[Expensive]] water shaders are required to be unmoving, because they have to always be certain of what can/should be drawn in surface reflections. [[Cheap]] water does not reflect the world, therefore it will never encounter the visibility problem.
It moves linearly along a given distance, in a given direction.


Only two [[material]]s are known to render correctly across all systems, these are <code>nature/water_movingplane</code> and <code>nature/water_dx70</code>. This is ostensibly because of how the material effects on the more complex water [[shader]]s require static brushes, so they can optimize what's visible to the water surface. A moving water surface would break this effect, so therefore full water shaders are unusable on a moving surface.
{{bug|Doesn't behave properly in {{l4d2}}! Physics don't behave properly if affected by this brush and graphical glitches can occur. Use sparingly and cautiously!}}
 
{{FuncMoveLinear notes}}
 
{{code class|CFuncMoveLinear|func_movelinear.cpp}}


{{bug|Doesn't behave properly in {{l4d2}}! Physics don't behave properly if affected by this brush and graphical glitches can occur. Use sparingly and cautiously!}}
==Flags==
{{not in FGD}}
{{Fl FuncMoveLinear}}


== Keyvalues ==
==Keyvalues==
{{KV|Move Direction (Pitch Yaw Roll)|angle|The direction the water will move, when told to '<code>Open</code>'.}}
{{KV FuncMoveLinear}}
{{KV|Start Position|float|Position of the water brush when spawned. The range is a value between 0.0 and 1.0, where 0 is the starting position and 1 is the starting position + (move direction * move distance).}}
{{KV visiblebrush}}
{{KV|Speed|integer|The speed that the water brush moves, in inches per second.}}
{{KV BaseEntity}}
{{KV|Move Distance|float|The distance from the starting point that the water brush should move, in inches.}}
{{KV|Sound played when the water brush starts moving|sound|Self-explanatory.}}
{{KV|Sound played when the water brush stops moving|sound|Self-explanatory.}}
{{KV|Wave Height|string|Legacy keyvalue from GoldSrc}}
{{KV Targetname}}
{{KV Parentname}}
{{KV Origin}}


== Inputs ==
==Inputs==
{{IO|Open|Move the water brush to the end position (starting position + (move direction * move distance)).}}
{{I FuncMoveLinear}}
{{IO|Close|Move the water brush to the starting position.}}
{{I visiblebrush|portal2=1}}
{{IO|SetPosition|Move the water brush to a specific position between 0.0 and 1.0, where 0 is the starting position and 1 is the starting position + (move direction * move distance).|param=string}}
{{I BaseEntity|prel4d=1}}
{{I Targetname}}
{{I Parentname}}


== Outputs ==
==Outputs==
{{IO|OnFullyOpen|Fired when the water brush reaches the end position (starting position + (move direction * move distance)).}}
{{O FuncMoveLinear}}
{{IO|OnFullyClosed|Fired when the water brush reaches the starting position.}}
{{O BaseEntity|l4d=1}}
{{O Targetname}}


== See also ==
==See also==
* [[Moving Water]]
*[[Moving Water]]


{{sfx_brush}}
[[category:SFX_Brush_Entities]]
[[Category:Water]]
[[Category:Water]]

Revision as of 05:43, 9 September 2018

English (en)Translate (Translate)

Template:Base brush It's a version of func_movelinear slightly specialized for use as water.

Only two materials are known to render correctly across all systems, these are nature/water_movingplane and nature/water_dx70. Expensive water shaders are required to be unmoving, because they have to always be certain of what can/should be drawn in surface reflections. Cheap water does not reflect the world, therefore it will never encounter the visibility problem.

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 ?]
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.
C++ In code, it is represented by theCFuncMoveLinearclass, defined in thefunc_movelinear.cppfile.

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

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.
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