How to use damage filters on a TF2 map?

Hectormd

L1: Registered
May 18, 2012
7
0
Hi there everybody :)

I decided to create a new thread for this topic to make it easier for other mates searching for the same info.

The thing is question is... how to use the damage filters? :confused:
I have seen these 2 videos:
* Hammer Advanced - Predefined weapons and blocking damage

* How To Remove Fall Dmg On SourceSDK hammer editor

I have tried several different things, like changing that "!Activator" for TestActivator (I tried this because i saw it on https://developer.valvesoftware.com/wiki/Filter_damage_type)

But it seems like I can't set it up in the right way, and I have not been able to find this specific info (TF2 related) anywhere.

Please could anybody provide some help to use it in a TF2 map (I'm kinda new to hammer so if it's possible add as many details/steps as you can :p)?

Let's say...
A map where a bot spawns
If I attack him he can only be damaged by critical hits (like a sniper's or spy's headshot, or a jarated bot which gets a Bushwacka hit)
If I attack him with a normal hit (any normal bullet, blast damage etc), he can't be damaged.

This one would be the ideal use example, since it's exactly what I want to do, otherwise, please only point me on the general use of these damage filters.

Thanks in advance :)
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
As far as I know, you can't target NPCs with filters. Mainly because a filter needs to be specified in the properties of the object recieving the damage and there's no way to specify that filter for players/bots.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
First you need a filter_damage_type set to crit damage. If you have my pack installed it will be labeled as "Critical" otherwise the default SourceSDK calls it "CHEMICAL" (or you can just type in the number, it is 1048576). Name the filter something, like critdamage. Also make sure it is set to the "allow" setting.

Then you need a trigger_multiple where the bots will spawn with the following output:
OnStartTouch|!activator|SetDamageFilter|critdamage
That will do as it says, and set the damage filter for the player entity to use.
 

Hectormd

L1: Registered
May 18, 2012
7
0
As far as I know, you can't target NPCs with filters. Mainly because a filter needs to be specified in the properties of the object recieving the damage and there's no way to specify that filter for players/bots.

Thanks for your info as well :) I really hope there is some way to do this.

First you need a filter_damage_type set to crit damage. If you have my pack installed it will be labeled as "Critical" otherwise the default SourceSDK calls it "CHEMICAL" (or you can just type in the number, it is 1048576). Name the filter something, like critdamage. Also make sure it is set to the "allow" setting.

Then you need a trigger_multiple where the bots will spawn with the following output:
OnStartTouch|!activator|SetDamageFilter|critdamage
That will do as it says, and set the damage filter for the player entity to use.

Thanks for the quick response :D
I do have your pack installed (awesome btw :O).

I did exactly as you said, but the bots won't get any damage from any source, I tried to invert the filter, to see if I could figure something out, but I couldn't :(, if I invert the filter to let's say "Disallow entities that match criteria" the bots would get damage from crits and no crits as well, everything can damage them.

Here
is a rar containing some images from the Filter damage set up, and the files of a very basic map both compiled and decompiled.

Or if you prefer all files separatelly:

(First 3 images which basically are your set-up instructions)

Damage Filter entity Set up:
DamageFilter_1_DamageFilter.jpg


Trigger Multiple set-up class info:
DamageFilter_1_TriggerMultiple_ClassInfo.jpg


Trigger Multiple set-up outputs:
DamageFilter_1_TriggerMultiple_Outputs.jpg


bsp file of the map
vmf file of the map
vmx file of the map


I'm confused :confused:
It seems like the filter either completelly allows or disallows any damage. Like not working exactly as a filter.

By the way I also did a try with your exact proposed config but I changed "Critical" to "BLAST (gibs on death)" to see if only that damage type filter wasn't working, and played as a demo man, and soldier, but same story, If I set to allow, nothing will harm the bots, if I set to disallow, everything will hurt the bots :crying:
I don't know what I am doing wrong :crying:
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
After experimenting with it, I guess weapon damage doesn't work as I had assumed. Weapons must all do the same kind of damage, and have a later modifier to apply the critical effect/multiplier, meaning you won't be able to filter it. I also tried using a filter_multi to combind a Generic and Critical filter (also generic/blast), but that didn't work either. So I think you're out of luck.
 

Hectormd

L1: Registered
May 18, 2012
7
0
After experimenting with it, I guess weapon damage doesn't work as I had assumed. Weapons must all do the same kind of damage, and have a later modifier to apply the critical effect/multiplier, meaning you won't be able to filter it. I also tried using a filter_multi to combind a Generic and Critical filter (also generic/blast), but that didn't work either. So I think you're out of luck.

Well in this video:
* Hammer Advanced - Predefined weapons and blocking damage

It does work that damage filter, but that's Counter Strike, so yes, like you say I might be out of luck :crying:

Thanks a lot for your help and time though :)

P. S. Anything you think that could be done with those other options from the filter? Like Test activator, Onpass, and OnFail?
 
Last edited: