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

func_fish_pool

From Valve Developer Community
Jump to navigation Jump to search
Class hierarchy
CFishPool
CBaseEntity
fish.cpp
Fish swimming inside water, thanks to a func_fish_pool entity.

func_fish_pool is a point entity available in all Source Source games. It creates a school of interactive fish that swim near this entity.
The fish themselves are being moved around slowly, and will scatter away quickly when being shot at, but they can not be hurt or individually picked off by shooting them.
The fish can also get stuck on geometry, such as the poles holding a pier, or boats that are placed on the water.

Tip.pngTip: If you plan on using fish in your map, you may want to animate the fish models themselves to animate the fins, because the fish entities themselves are just sliding around in random patterns, being bound to the same height as the func_fish_pool entity has been placed.
It appears as though the animation on the fish speeds up when they flee, and slows down when idly swimming about.
Warning.pngWarning:Killing the func_fish_pool does not delete the fish. If you want to remove the fish, you will need to kill the func_fish_pool first, and the fish second, else the game will crash.
Furthermore, at least in Left 4 Dead 2 using relays to kill the fish entities crashes the game, every time, no matter what.
Warning.pngRisk of Confusion:This is a point entity despite the name starting with func_ (which is usually used for brush entities). Perhaps this entity was akin to func_precipitation before being changed.

Keyvalues

Name (targetname) <string>
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

World model (model) <model path>
Model spawned fish use.
Fish Count (fish_count) <integer>
Number of fish in this pool.
Max Range (max_range) <float>
How far away a fish can wander, in units. Maximum is 255 units.

Lighting Issues

Fish spawned by this entity can cause lighting issues, where all dynamic props (including doors and viewmodels) appear to flicker dark.
This may appear when a mere 30 fish have been spawned. Adding $donotcastshadows to the fish models did not help.
Furthermode, these fish will not fade out like any other prop, since Fademindist and Fademaxdist do not exist for Func_Fish_Pool, or Fish.

Add a hollow box of Func_areaportal around all Func_Fish_Pool entities, including their "Max Range". Every side should be an individual func_areaportal with the same name, all of which closed by default.
Add a trigger_multiple in the spot where you want the fish to be visible when stood in, with the following outputs:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch Func_areaportal open <none> 0.00 No
Io11.png OnEndTouchAll Func_areaportal close <none> 0.00 No
Todo: Find out whether a $lod that removes the fish could also fix this issue.

Console Commands

Fish entities have two console commands.

Command Default Parameters Description
fish_debug 0 "cheat", "cl" Show debug info for fish
fish_dormant 0 "sv", "cheat", "rep" Turns off interactive fish behavior. Fish become immobile and unresponsive.

Fish

The fish entities spawned by the func_fish_pool can not be interacted with. They do not have any unique inputs, other than being able to be killed with console commands.
Killing the fish via relays in some games crash the game even when done in proper order by killing the func_fish_pool first, making the fish nothing but an interactive decoration.
They are comparable to particles, except they are made of models and respond to player proximity as well as gunshots near them.