Normal Water
Water in hl2 is a little illogical to make, but following these steps isn't:
- Create brushes where you want the water to be. Make sure the top side is horizontal.
- Apply all waterbrushes with the tools\nodraw texture.
- Select ONLY the top faces of all waterbrushes, and give them a water-texture. Any water-texture will do, but mind the names. If you see "cheap" in the name, you'll get cheap water, water that looks worse than normal but takes less power to draw.
Some rather strange rules apply to water in HL2:
- Contrary to HL1, water in HL2 is not an entity. Never tie water to an entity, or it'll render all wrong. So the func_water should not be used in HL2. Its just there to confuse you.
- If your map isn't compiled with vvis and vrad, and/or has leaks, the water will not render properly
- There may be only one water level height in any part of the map if the water brushes can see each other. Stop them from seeing other water brushes by building walls to block their visibility. fast-vvis will do a worse job in calculating if brushes see each other, so make sure you run it normally if you suspect water brushes with multiple heights can see each other.
- A water brush with a "cheap"-watertexture isn't allowed to see a water brush with a normal water texture.
- Don't overuse them, especially in multiplayer maps. They may lag a lot (and if they do, try to use the "cheap" waters instead)
- Water doesn't have sides, only a top. Even though there is a fog effect when you are inside the water, you won't get that outside the water (e.g. when you are looking at it from the sides)
Rising Water
To create rising water, you should break the first rule: Tie all brushes representing water (made like explained above) you would like to rise to a func_water_analog. It has a few properties to fiddle with, here they are:
The only properties you need to fiddle with to make this work, are in
bold. All the other properties work on default (but can be changed if necessary). To make the water rise, target it with the "Open"-input, and to make it go down again target it with the "Close"-input
PROPERTIES
- Name targetname: The name that other entities refer to this entity by.
- Parent parentname: The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
- Origin (X Y Z): The position of this entity's center
- Move Direction (Pitch Yaw Roll): The direction the water will move, when its "open" input is triggered normally you would make it target upwards
- Start Position: 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).
- Speed: The speed that the water brush moves, in inches per second.
- Move Distance: The distance from the starting point that the water brush should move, in inches.
- Sound played when the water brush starts moving.
- Sound played when the water brush stops moving.
- Wave Height: height of the waves.
- Kill: Removes this entity from the world.
- KillHierarchy: Removes this entity and all its children from the world.
- AddOutput: Adds an entity I/O connection to this entity. Format
- FireUser1: Causes this entity's OnUser1 output to be fired.
- FireUser2: Causes this entity's OnUser2 output to be fired.
- FireUser3: Causes this entity's OnUser3 output to be fired.
- FireUser4: Causes this entity's OnUser4 output to be fired.
- SetParent: Changes the entity's parent in the movement hierarchy.
- SetParentAttachment: Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
- ClearParent: Removes this entity from the movement hierarchy, leaving it free to move independently.
- Open: Move the water brush to the end position (starting position + (move direction * move distance)).
- Close: Move the water brush to the starting position.
- 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).
OUTPUTS
- OnUser1: Fired in response to FireUser1 input.
- OnUser2: Fired in response to FireUser2 input.
- OnUser3: Fired in response to FireUser3 input.
- OnUser4: Fired in response to FireUser4 input.
- OnFullyOpen: Fired when the water brush reaches the end position (starting position + (move direction * move distance)).
- OnFullyClosed: Fired when the water brush reaches the starting position.
One small note is, that this entity isn't bug-free: bugs may appear when you are in the water and are able to look at the sky. Also not everything that floats in normal water floats in this water. Just be warned.
This article was originally published on
69th Vlatitude.
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the
TWHL Archiving Project page.