Filter enemy

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)

Template:Base point 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.

C++ In code, it is represented by theCFilterEnemyclass, defined in thefilters.cppfile.

Flags

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

Keyvalues

Name/Classname (filtername) ([todo internal name (i)]) <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) ([todo internal name (i)]) <float>
Radius an enemy must be within.
Outer Radius (filter_outer_radius) ([todo internal name (i)]) <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) ([todo internal name (i)]) <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 <variantRedirectInput/variant>
Tests the entity that called the input (the !activator) against the filter, and fires either the OnPass or OnFail output. (the parameter it takes is unused)
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
!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.