Water fountain

Classname: env_water_fountain
Purpose: A nice refreshing shower
code: g_waterfx.c
fields required: delay
The water fountain is a jet of water with a fixed direction & a spray effect at its base (so you don't need to coordinate it with an env_waterfall_base entity). Water jet starts at the origin (location) of the entity, travels as determined by the angle or angles field and gravity, ending with the spray effect at whatever distance below the origin is specified by the delay field. The code comments and HereticEd document say that the delay-value shouldn't be greater than 245, but values up to 570 appear in the maps, & 300 seemed to work fine for me.

For simple aiming in the xy plane the angle field will be used, for more elaborate aiming effects use the angles field as discussed below. With neither, the water will fall straight down to the floor. A design tip is that the older water-images occlude the newer ones, so a fountain with an upward arcing spray looks good from the front but not the back, and can also look wierd from above.

Fields

delay value is a number, vertical distance from origin base. If this field is omitted, the fountain looks like a pulsing blob.
angle value is a number, default 0, directs jet in horizontal plane, going a smallish outward distance (looks like about 32 units to me, but I haven't checked it carefully). Overrides angles.
angles value is a triple of numbers, X Y Z distance travelled by jet. E.g. for a flow that will go quite a distance in the northeast direcion, try 300 300 0. If you want to use this, don't use an angle field, because it will override it.
targetname value is a name, targetted by an entity that turns the fountain on and off. Starts on unless the START_OFF spawnflag is set.
spawnflags
  • 1 - START_OFF: for a targetted water fountain, makes it start in the off-state and turn on when triggered.

Return to the Tutorials.