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 Jump to search
English (en)Translate (Translate)
Class hierarchy
CFilterEnemy
CBaseFilter
CLogicalEntity
CServerOnlyEntity
CBaseEntity
filters.cpp
Filter class.png

filter_enemy is a logical 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

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

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

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.
Note.pngNote:This filter doesn't cause the server to crash as most other filters do if activator entity no longer exists.

Outputs

BaseFilter:

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