From 465c0b726a44f8f84a4050977dae082d515665d7 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Thu, 18 Jun 2020 10:55:27 -0500 Subject: [PATCH] Added filter_script --- Filters.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Filters.md b/Filters.md index 2146fff..8a61d09 100644 --- a/Filters.md +++ b/Filters.md @@ -10,11 +10,11 @@ A filter is a type of entity that can test another entity against a certain cond In Mapbase, all filters have been given the following new I/O/KV: **Inputs** -* **TestEntity** `` - Tests the filter against the specified entity and fires OnPass or OnFail based on the result. *(TestActivator only uses the activator)* +* **TestEntity** `` - Tests the filter against the specified entity and fires `OnPass` or `OnFail` based on the result. *(TestActivator only uses the activator)* * **SetField** `` - Sets this filter's primary testing criteria (e.g. the name to test against the activator). **KeyValues** -* **Pass caller when tested** `` - When tested with TestActivator or TestEntity, this causes the OnPass and OnFail outputs to use the entity that called the test as the caller instead of the filter itself. +* **Pass caller when tested** `` - When tested with `TestActivator` or `TestEntity`, this causes the `OnPass` and `OnFail` outputs to use the entity that called the test as the caller instead of the filter itself. --- @@ -49,7 +49,7 @@ Here's a list of the redirect filters introduced in Mapbase: | Name | Description | |:-------------:|:-------------| -| filter_redirect_weapon | Redirects the activator's weapon. *(as a damage filter, this gets the weapon used in the damage)* | +| filter_redirect_weapon | Redirects the activator's weapon. When used as a damage filter, this gets the weapon used in the damage. | | filter_redirect_owner | Redirects the activator's owner entity. | | filter_redirect_inflictor | As a damage filter, this redirects the inflictor of the damage, e.g. the grenade in an explosion. (filters normally use the attacker) | @@ -72,4 +72,24 @@ Here's a list of the redirect filters introduced in Mapbase: | filter_damage_transfer | Causes damage taken by entities using this filter to transfer to a different entity, or a set of entities. | | filter_damage_mod | Modifies damage taken by entities using this filter. | | filter_damage_logic | Fires outputs with damage parameters whenever an entity using this filter takes damage. | -| filter_blood_control | Controls whether blood can be emitted when an entity using this filter takes damage. *(does not affect actual damage on its own)* | \ No newline at end of file +| filter_blood_control | Controls whether blood can be emitted when an entity using this filter takes damage. *(does not affect actual damage on its own)* | + +--- + +### filter_script + +

+ +

+ +**`filter_script`** is a special filter which allows filter functions to be controlled by VScript. See [[VScript in Mapbase]] for more information on VScript. + +Here's a list of the hooks `filter_script` can use: + +| Signature | Description | +|:-------------:|:-------------| +| *bool* PassesFilter(handle *caller*, handle *entity*)| Check if the given caller and entity pass the filter. | +| *bool* PassesDamageFilter(handle *caller*, handle *info*)| Check if the given caller and damage info pass the damage filter. | +| *bool* PassesFinalDamageFilter(handle *caller*, handle *info*)| Used by filter_damage_redirect to distinguish between standalone filter calls and actually damaging an entity. Returns true if there's no unique behavior. | +| *bool* BloodAllowed(handle *caller*, handle *info*)| Check if the given caller and damage info allow for the production of blood. | +| *bool* DamageMod(handle *caller*, handle *info*)| Mods the damage info with the given caller. | \ No newline at end of file