Filter Entities

- By Raeven0
This tutorial was last updated on Feb 8, 2006.

filter_activator_class
filter_activator_name
filter_activator_team

What do these entities do?

Sometimes, you'll want an entity (such as a teleporter) to affect only a certain team or only a certain prop. These filter entities allow you some control over just that.

All trigger entities (trigger_teleport, trigger_push, etc.) have a Filter Name property. If you place a filter_activator entity in your map and give it a name, then that filter will be called to see if the entity activating the trigger is allowed to activate it. For instance, with filter_activator_name, you can set a rule that only entities named Bob can be teleported by a trigger_teleport.

If the entity trying to activate the trigger (a player trying to use a teleport) is not named Bob, the teleport will not work. Thus, this teleport would never affect players, because all players bear the name player! But a prop_physics named Bob would be teleported.

So, the filter entities allow you to test whether entity A should be affected by trigger B... but there's more!

Filter entities also accept a TestActivator input. When an entity sends this input to a filter, the original activator is tested against the filter's criteria. If the activator passes the criteria, the filter fires its OnPass outputs; if the activator fails the criteria, the filter fires it OnFail outputs.

In our teleport that only allows Bob, suppose that instead of using its "Filter Name" property, you just add an output to the teleport: OnStartTouch. When anything touches the teleport, it fires this output--which should fire your filter with the TestActivator input. In turn, the filter can have an OnPass output (which will be fired if the item inside the teleport is named Bob) to enable the teleport (via an Enable input), or an OnFail output (the activator was not named Bob) that kills the activator instantly.

See a real application for filter entities in Tutorial: One-Team Door.



Still need help? Ask your questions in one of our HELP FORUMS
Post A Comment
Name:
Email: Links Not Allowed In Comments
Comment:
What is the capital of France? Need Help?
Comments
LocalMapper - Jan 2, 2009
Hey, i need some help with the filter_activator_name entity.

i want to open a door, wich only a gun can do. so i named a
xm1014 weapon the name xm1014


then i got a trigger_multi with this settings

Starts disabled=No
Filter Name= filter_activator_name
Delay Before Reset= 1

Flags= Everything, wont blablablaba

Output = OnStartTouch -> filter_activator_name -> TestActivator

Entity filter_activator_name

Name= filter_activator_name
Filter Mode= Allow entities that match criteria
Filter Name= xm1014

Output=
OnPass-> door1-> Open
OnFail -> door1 -> Close

func_door
name= door1

flags = none

it wont work, help please :)
All original content ©2006 EditLife.net. All Rights reserved. All files property of their rightful owners.
Get Firefox! Get Thunderbird! Get Notepad++!