Trigger
Quote from Lostprophetpunk on July 6, 2011, 3:13 amHeya there,
I am almost half way through building my map at the moment. I was wondering if it is possible to use a trigger, not for the player, but for a cube.
Such as when the cube touches the trigger, certain stuff will happen. I know how to do the stuff that will happen from the trigger, just need to know how to set the trigger off with the cube.
How would I go about this?
Heya there,
I am almost half way through building my map at the moment. I was wondering if it is possible to use a trigger, not for the player, but for a cube.
Such as when the cube touches the trigger, certain stuff will happen. I know how to do the stuff that will happen from the trigger, just need to know how to set the trigger off with the cube.
How would I go about this?
|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||
Quote from Rubrica on July 6, 2011, 3:25 amhttp://developer.valvesoftware.com/wiki/Filter
Filters basically check if something fits a certain criteria (e.g., 'is a cube') and if it does, triggers the trigger. I thin there's a key value on trigger brushes that sets what filter it uses.
http://developer.valvesoftware.com/wiki/Filter
Filters basically check if something fits a certain criteria (e.g., 'is a cube') and if it does, triggers the trigger. I thin there's a key value on trigger brushes that sets what filter it uses.
Quote from taboo54 on July 6, 2011, 4:22 amalso make sure to check the 'Flags' tab in the Trigger's properties and make sure "Client' is unchecked and "Physics Objects" is checked
also make sure to check the 'Flags' tab in the Trigger's properties and make sure "Client' is unchecked and "Physics Objects" is checked
Quote from Lostprophetpunk on July 6, 2011, 11:33 amThank you both, this has helped greatly.
Thank you both, this has helped greatly.
|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||
Quote from ChickenMobile on July 6, 2011, 1:37 pmEither one of those solutions will work. However I would suggest just using the trigger 'flag' option as this will reduce the amount of entities you need to use and 'de-complicate' it a little.
If you want a specific cube to activate it (for example you have a redirection cube and a frankenturret and you want the redirection cube to activate the trigger) then use a filter.
Either one of those solutions will work. However I would suggest just using the trigger 'flag' option as this will reduce the amount of entities you need to use and 'de-complicate' it a little.
If you want a specific cube to activate it (for example you have a redirection cube and a frankenturret and you want the redirection cube to activate the trigger) then use a filter.
Quote from Lostprophetpunk on July 6, 2011, 2:24 pmchickenmobile wrote:Either one of those solutions will work. However I would suggest just using the trigger 'flag' option as this will reduce the amount of entities you need to use and 'de-complicate' it a little.If you want a specific cube to activate it (for example you have a redirection cube and a frankenturret and you want the redirection cube to activate the trigger) then use a filter.
I went with the easier option lol. Going to take me a while to get my head around filters. As I looked at that page and just got confused quite quickly.
If you want a specific cube to activate it (for example you have a redirection cube and a frankenturret and you want the redirection cube to activate the trigger) then use a filter.
I went with the easier option lol. Going to take me a while to get my head around filters. As I looked at that page and just got confused quite quickly.
|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||
Quote from Marise on July 6, 2011, 2:45 pmFilters sound scary, but they are actually pretty simple. For this example I will discuss filter_activator_name, which checks for any entity with a certain name, e.g. "cube1." In the filter's values, there is a setting which I believe is called Filter Name. That is where you type in the entity name you are filtering for ("cube1"). In Outputs, select OnPass and set up the output you want, such as opening a door. You can also set up OnFail to close the door, for example.
Now take your button or trigger and set the Output, OnPressed or OnTrigger, to command the filter to perform the action TestActivator. In other words, when the trigger is activated by any entity, it signals the filter to examine that entity. If it has the correct name, the filter fires its output. If not, it does nothing or else fires the OnFail output.
Think of the filter as one extra step. Rather than your trigger sending a command directly to a door, item dropper, etc, it instead commands the filter to do a quick pass/fail test, and then the filter sends the output.
So you might have something like this:
Trigger-
OnTrigger
filter1
TestActivatorFilter-
OnPass
door1
OpenOnFail
door1
Close
Filters sound scary, but they are actually pretty simple. For this example I will discuss filter_activator_name, which checks for any entity with a certain name, e.g. "cube1." In the filter's values, there is a setting which I believe is called Filter Name. That is where you type in the entity name you are filtering for ("cube1"). In Outputs, select OnPass and set up the output you want, such as opening a door. You can also set up OnFail to close the door, for example.
Now take your button or trigger and set the Output, OnPressed or OnTrigger, to command the filter to perform the action TestActivator. In other words, when the trigger is activated by any entity, it signals the filter to examine that entity. If it has the correct name, the filter fires its output. If not, it does nothing or else fires the OnFail output.
Think of the filter as one extra step. Rather than your trigger sending a command directly to a door, item dropper, etc, it instead commands the filter to do a quick pass/fail test, and then the filter sends the output.
So you might have something like this:
Trigger-
OnTrigger
filter1
TestActivator
Filter-
OnPass
door1
Open
OnFail
door1
Close
Thanks for over 1,000 downloads: The Cold Shoulder
Quote from Omnicoder on July 6, 2011, 3:54 pmMarise wrote:Filters sound scary, but they are actually pretty simple. For this example I will discuss filter_activator_name, which checks for any entity with a certain name, e.g. "cube1." In the filter's values, there is a setting which I believe is called Filter Name. That is where you type in the entity name you are filtering for ("cube1"). In Outputs, select OnPass and set up the output you want, such as opening a door. You can also set up OnFail to close the door, for example.Now take your button or trigger and set the Output, OnPressed or OnTrigger, to command the filter to perform the action TestActivator. In other words, when the trigger is activated by any entity, it signals the filter to examine that entity. If it has the correct name, the filter fires its output. If not, it does nothing or else fires the OnFail output.
Think of the filter as one extra step. Rather than your trigger sending a command directly to a door, item dropper, etc, it instead commands the filter to do a quick pass/fail test, and then the filter sends the output.
So you might have something like this:
Trigger-
OnTrigger
filter1
TestActivatorFilter-
OnPass
door1
OpenOnFail
door1
CloseOr just set the trigger's filter keyvalue to the name of the filter and it'll do all the work for you.
Now take your button or trigger and set the Output, OnPressed or OnTrigger, to command the filter to perform the action TestActivator. In other words, when the trigger is activated by any entity, it signals the filter to examine that entity. If it has the correct name, the filter fires its output. If not, it does nothing or else fires the OnFail output.
Think of the filter as one extra step. Rather than your trigger sending a command directly to a door, item dropper, etc, it instead commands the filter to do a quick pass/fail test, and then the filter sends the output.
So you might have something like this:
Trigger-
OnTrigger
filter1
TestActivator
Filter-
OnPass
door1
Open
OnFail
door1
Close
Or just set the trigger's filter keyvalue to the name of the filter and it'll do all the work for you.
