entityguide‎ > ‎

func_water

This entity is used to create water. In game, every flat surface of the brushes of this entity will be waving up and down a specified distance. The brushes which are part of this must be cuboids, ideally snapped to 64-units-grid. It requires liquid ('!') texture for waving.
Func_water is also a door type. Can be triggered to be opened and closed. Func_water should be touching the floor whenever it's closed
or open or it may produce strange errors or become invisible. Func_water have breakable functionality (if enabled) just like other door types. However cannot be destroyed by direct attack (bullet/melee), you can still destroy func_water by explosions or area of effect attacks
(e.g. weapon_egon). The water can be opened and closed just like a normal doors.

Keyvalues


"Speed", speed :
Movement-speed of water (when activated) in units per second.

"Master",
 master :
Put the name of a multisource entity to lock this water like you can lock doors.

"Move Sound", movesnd :
Sound that is played while the water brush is moving.

"Move Sound Loops?", movesnd_loop :
Sets if Move Sound should be looped during brush movement until it stops.

"Stop Sound",
 stopsnd :
Sound which is played once as the water brush stops moving.

"Move Sound Override", noise1 :
Custom sound file that is playing when entity is moving. Overrides default "Move Sound" sound.

"Stop Sound Override", noise2 :
Custom sound file to play when the entity ends movement. Overrides default "Stop Sound" sound.

"Delay before close; -1 stay open", wait :
Delay till the water brush will automatically close after having opened. Setting this to -1 makes the water never close again. When the water is toggleable, this is obsolete.

"
Lip", lip :
Length in units to subtract from the precomputed movement-distance of the water. Negative values increase the movement-distance.

"
Damage inflicted when blocked", dmg :
Water have no collision so this keyvalue is useless.

"Fire on open (obsolete)", fireonopen :
Target to trigger when the water finishes opening.

"Fire on close (obsolete)", netname :
Target to trigger when the water finishes closing.

"Fire On Open Start", fireonopening :
Entity to trigger when water starts opening.

"Fire On Open Start Trigger State", fireonopening_triggerstate:
Set the use-type with which the entity specified above will be fired.

"Fire On Close Start", fireonclosing :
Entity to trigger when water starts closing.

"Fire On Close Start Trigger State", fireonclosing_triggerstate:
Set the use-type with which the entity specified above will be fired.

"Fire On Open End", fireonopened :
Entity to trigger when water ends opening.

"Fire On Open End Trigger State", fireonopened_triggerstate:
Set the use-type with which the entity specified above will be fired.

"Fire On Close End", fireonclosed :
Entity to trigger when water end closing.

"Fire On Close End Trigger State", fireoncloed_triggerstate:
Set the use-type with which the entity specified above will be fired.

"
Strength", health :
Amount of damage to take before they gets destroyed (when "Breakable" is set to 'Yes').

"
Locked Sound", locked_sound :
Sound to play when a player tries to open the water but it's locked because it has a targetname or uses a multisource entity.

"
Unlocked Sound", unlocked_sound :
Another sound to play when the water is opened.

"
Locked Sentence", locked_sentence :
Sentence to play when a player tries to open the water but it's locked because it has a targetname or uses a multisource entity. (Only works a few times, probably because it'd be weird if the announcer was spamming all the time)

"
Unlocked Sentence", unlocked_sentence :
Sentence to play when the water is opened (only works a few times, probably because it'd be weird if the announcer was spamming all the time).

"Locked Sound Override", locked_sound_override :
Sound file to use when attempting to open locked entity. Useful when you don't want to use sound from default sound list.
This overrides default "Locked Sound" sound.

"Unlocked Sound Override", unlocked_sound_override :
Sound file to use when entity is unlocked. Useful when you don't want to use sound from default sound list.
This overrides default "Locked Sound" sound.

"Locked Sentence Override", locked_sentence_override :
Sentence from sentences.txt to use when attempting to open locked entity. Useful when you want to override locked sentence with your own sentence.

"Unlocked Sentence Override", unlocked_sentence_override :
Sentence from sentences.txt to use when entity is unlocked. Useful when you want to override unlocked sentence with your own sentence.

"Sound Replacement File", soundlist :
Allows you to setup a sound replacement file for the func_water sounds. The path begins in 'svencoop/sound/mapname', whereas 'mapname' would be your map's name. You can go to the parent directory using '../'. A valid sound replacement file contains one or more lines with two sound-paths, which are separated by a space and wrapped into quotes. The first sound is the sound to be replaced. The second sound is the new sound. Sound-paths start in the sound directory. You cannot go to the parent directory using '../' in that case. These sounds do not need to be precached using a custom_precache point entity.

"Who can open this", m_iOpenFlags :
Specify who can open this water by using it (if it has no targetname, or targetname is set to be ignored (see below)). If set to something other than default, this will cause the old spawnflags which are usually used to keep track of this to be ignored and causes the water to only orient using this setting instead.

"
Ignore Targetname", m_fIgnoreTargetname :
Set whether the water should ignore its targetname or not. This is useful when you need to reference the func_water in another entity but still want the water to open on touch.

"Obey Trigger Mode", m_iObeyTriggerMode :
Originally, func_water would not interpret use-types "Off" and "On" as "Toggle". This keyvalue allows you to use "On" to open the water and "Off" to close the water. You can also set this to have the water react to "On"- and "Off"-triggering while it is moving, and go closing when it is currently opening and vice versa.

"Breakable", breakable :
If set to 'Yes', the water also breakable (by Area of Effect damage), just like func_breakable entity. All breakable keyvalues are functional when this key is set to 'Yes':
  • "Strength", health Set how many hitpoints this entity has.

  • "Fire on break", target The entity triggers its target when it breaks.

  • "Material type", material Choose the material which matches what your entity is supposed to be the most. The material type affects the entity's sounds emitted when it takes damage, as well as which gibs are created when it is destroyed. 
    If the material is set to 'Unbreakable glass', the entity is, regardless of how funny that is, in fact, unbreakable.

  • "Instant break", instantbreak  If set to 'Yes', this entity will break instantly if hit with a crowbar.

  • "Instant break weapon", weapon Allows you to specify an instant-break weapon other than the crowbar.

  • "Gibs direction and velocity", explosion Set whether the gibs fly relative to where the attack came from, damage received and material (e.g. concrete gibs fly with less velocity) or randomly. This has no effect on entities destroyed via a trigger. Note: Blowing up stuff is much more fun when shit goes flying instead of just falling to the ground as if nothing happened.

  • "Gib model", gibmodel Custom model of broken entity parts. Models with multiple 'Submodels' uses all of sub-models 
    for gibs.

  • "Explode Magnitude (0=none)", explodemagnitude : If greater than zero, the entity will cause an explosion at its position when it breaks. The greater the magnitude, the more damage the explosion will cause. Note that explosion damage values above 200 are know to cause explosion damage to even go through walls.

  • "HUD info name", displayname : If "Show HUD Info" is set to 'Yes', this is a name of entity to display on-screen when player is looking at this entity.

  • "Only Trigger", onlytrigger : Set it to 'Yes' to make entity breakable only via triggering it.

  • "Break on Trigger", breakontrigger Set it to 'Yes' to make entity breakable via trigger. It is not a duplicate 
    of keyvalue above.

  • "Repairable", repairable If set to 'Yes', this entity can be repaired by using weapon_pipewrench on it.

  • "Show HUD info", showhudinfo If set to 'Yes', the HUD information (name, health e.t.c.) are shown.

  • "Immune to Clients", immunetoclients Players can't deal a damage to this entity when this option is set to 'Yes'.

  • "Explosives Only", explosivesonlyIf set to 'Yes', this entity can be damaged by explosives only.

"Contents", skin :
Content of the water to use. Content like 'SLIME' and 'LAVA' turns water into damaging liquid- the same effect can by achieved
by using trigger_hurt. CURRENT values work similar to trigger_push- it makes water push object like func_pushable inside
of it (but not player) in selected direction (yaw directions: up, down, 0, 90, 180 or 270). 'TRANSLUCENT' disables water underwater visual/sounds effects.

"Wave Height", WaveHeight :
Height of the waves. Larger values for higher waves.

Inventory Rules, InventoryRules @BaseClass:
List of inventory-related keyvalues used with item_inventory entity. Whenever player is attempting to use an entity, the inventory test runs. If test result is negative, the entity won't work. In other case, entity can be used as normal, but only by player who passed the test with required inventory conditions:
  • "Inventory: Need item(s)", item_name_required : Item(s) (names separated by spaces) required to use this entity. 
    Refers to "Item name" value of item_inventory.

  • "Inventory: Need item(s) from group(s)", item_group_required : Groups (separated by spaces), in which carried items belong to, required to use this entity. Refers to "Item group name" value of item_inventory.

  • "Inventory: Item count in group need have", item_group_required_num : Minimal number of items, that belong 
    to specified group, required to use this entity. Use with "Inventory: Need item(s) from group(s)" keyvalue. Value of '0' means that all items from current group are required.

  • "Inventory: CAN'T have item", item_name_canthave : Items in player inventory that will fail the test, and disallow usage 
    of this entity. Refers to "Item name" value of item_inventory.

  • "Inventory: CAN'T have item from group", item_group_canthave : Items in player inventory, which belong to specified group, that will fail the test, and disallow usage of this entity. Refers to "Item group name" value of item_inventory.

  • "Inventory: Item count in group CAN'T have", item_group_canthave_num : Minimal number of items in player inventory, which belong to specified group, that will fail the test, and disallow usage of this entity. Refers to "Item group name
    value of item_inventory. 
    Value of '0' means no single item from current group should be equipped to pass the test.

  • "On pass: Ignore item's on use triggers?", pass_ignore_use_triggers : If set to 'Yes' item's trigger targets from 'Target: On use (by trigger)' will not be fired when item is used by this entity.

  • "On pass: Drop item(s)", pass_drop_item_name : Items to force-drop when the test result is positive, and entity is used successfully. Refers to "Item name" value of item_inventory. Multiple item names are separated by spaces.

  • "On pass: Drop item(s) from group(s)", pass_drop_item_group : Items to force-drop, that belong to specified group, when the test result is positive, and entity is used successfully. All items from this group will be dropped. 
    Refers to "Item group name" value of item_inventory. Multiple item names are separated by spaces.

  • "On pass: Ignore item's on drop triggers?", pass_ignore_drop_triggers : If set to 'Yes' item's trigger targets from 'Target: On drop' will not be fired when item is dropped by this entity with 'Drop items(s)' events above.

  • "On pass: Return item(s)", pass_return_item_name : Items to return to their starting positions when test result is positive. Refers to "Item name" value of item_inventory. Multiple item names are separated by spaces.

  • "On pass: Return item(s) from group(s)", pass_return_item_group Items, that belong to specified group, to return to their starting positions when test result is positive. All items from this group will be returned. Refers to "Item group name" value of item_inventory. Multiple group names are separated by spaces.

  • "On pass: Ignore item's on return triggers?", pass_ignore_return_triggers : If set to 'Yes' item's trigger targets from 'Target: On return' will not be fired when item is returned by this entity with 'Return items(s)' events above.

  • "On pass: Destroy item(s)", pass_destroy_item_name : Items to remove when test result is positive. Refers to "Item name" value of item_inventory. Multiple item names are separated by spaces.

  • "On pass: Destroy item(s) from group(s)", pass_destroy_item_group : Items, that belong to specified group, to remove when test result is positive. All items from this group will be removed. Refers to "Item group name" value 
    of item_inventory. Multiple group names are separated by spaces.

  • "On pass: Ignore item's on destroy triggers?", pass_ignore_destroy_triggers : If set to 'Yes' item's trigger targets from 'Target: On Destroy' will not be fired when item is destroyed by this entity with 'Destroy items(s)' events above.

  • "Target: Inventory rules failed", target_on_fail : Entity to trigger whenever test result is negative.


Flags


1: "Starts Open": If set, the water will treat its predetermined open- and close-position as swapped, meaning it will start in its open position, but treat it as its closed position. This is useful when you want your water to start open and still receive proper lighting, or the node-graph to generate properly before closing the water manually (if it is a toggleable water).

4
: "Don't link": If set, this water won't synchronize its movement with identically named water brushes. This is useful when triggering many water brushes with different speeds or different movement-lengths by the same name. If not set, water brushes with the same name will adjust their individual speeds to open/close simultaneously, orienting at how the first related water the game engine finds would behave timing-wise.

8
: "Passable": If set, the water is entirely non-solid. This keyvalue doesn't affect func_water because it has no collision box anyway.

32
: "Toggle": If set, this water ignores its delay before closing; nonetheless, it must not be 0 then for some reason.

256
: "USE Only": If set, this water can be triggered by using it but not by touching it anymore. It should be selected if you need your water to be opened or closed by using it by whatever reason.

512
: "Monsters Can't": If set, monsters cannot cause this water to move. They can, otherwise, even if it is a use-only- or trigger-only-water, so don't forget to set this when you need it!

1024
: "No Link-Checking": If set, the water won't check for water brushes to link with, causing this water brush to not be considered for link-orientation by the game engine; it can still be caused to be linked by other func_water.


Notes

  • It is advised to experiment with large texture scale values on the water surface, as the game engine will first fit the texture 
    to be 64 units wide and high. Doing so can greatly improve performance and looks.


Issues

  • Rotating the surface texture by non-by-90-divisible values causes shred water surface.
  • Old compile tools such as ZHLT 3.4 will not correctly compile this entity when there is more than 1 brush part of it.
  • Multiple func_water entities touching on edge will not correctly blend into each other unless both are snapped to 64-units-grid 
    on the touching corners.


Changes

  • 5.0 Steam Release: Added 'Inventory Rules', 'Locked Sound Override', 'Unlocked Sound Override', 'Locked Sentence Override', 'Unlocked Sentence Override', 'Move Sound Override' and 'Stop Sound Override' keyvalues.


Comments