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

filter_enemy

From Valve Developer Community
Jump to: navigation, search
English (en)
... Icon-Important.png
class hierarchy
CFilterEnemy defined in filters.cpp
CBaseFilter
CLogicalEntity
CServerOnlyEntity
CBaseEntity
Filter class.png

filter_enemy is a point entity available in all Source Source games. It is a filter intended to filter a potential enemy entity by a set of criteria. Despite the name, much of its functionality is not enemy-related, allowing it to be used as a name and proximity filter for any type of entity. Enmity and proximity are measured relative to the !caller.


Flags

  •  [1] : Do not lose target if already acquired but filter failed.

Keyvalues

Name/Classname (filtername) <string>
The classname or targetname to filter by. If no string is given, all entities will have further criteria tested. Entities for which further criteria are not tested will always pass the filter. A filtername of '!player' is treated specially and will pass if the enemy entity is a player.
Radius (filter_radius) <float>
Radius an enemy must be within.
Outer Radius (filter_outer_radius) <float>
Enemies outside this radius are considered invalid if Allow is set and valid if Disallow is set.
Max Squadmates Per Enemy (filter_max_per_enemy) <integer>
Maximum number of squadmates allowed to target any given entity.

BaseFilter:

Filter mode (Negated) <boolean>
Inverts the filter, making the specified criteria fail and all others pass.

Inputs

BaseFilter:

TestActivator
Tests the entity that called the input (the !activator) against the filter, and fires either the OnPass or OnFail output.
Icon-Bug.pngBug:Calling this input will cause the server to crash if the !activator entity no longer exists. Do not use this input to test any entities which may be asynchronously deleted, such as players or projectiles, or in an i/o chain which might be initiated by entity deletion, such as the OnEndTouch output of a trigger.

Outputs

BaseFilter:

OnPass
OnFail
One of these will fire when TestActivator input is sent, depending on if the activator is allowed by the filter or not.