Waldo
Valve N

Registered: Apr 2003 |
Setting up triggers
Setting Up Triggers
Setting up triggers in Source is totally different.
You know how multi_managers worked in HL1? Well every entity is like that now - it can have many triggers.
So here's an example. Suppose you wanted a trigger_multiple that played some sound when a player entered the area. Here are the steps...
- Create an ambient_generic for your sound. Give it a name like "alarmsound".
- Create your trigger_multiple
- Go to the "Outputs" tab of the trigger_multiple
- Click the "Add" button at the bottom - a new row is added to the little table you see
- In the text edit field labeled "Targets entities named" type in the name of the ambient_generic. You actually don't need to type it though, as the dropdown has a list of all the entities with names already!
- Now click on the dropdown next to the entry field labled "Via this input". This is a list of all the ways you can trigger that ambient_generic. You'd probably choose "PlaySound" but you could also trigger it to Stop or Toggle the sound (or a few other things).
- Lastly, go to "My output named" and choose WHEN you want to trigger the sound. You'll see a variety of options, like "On Start Touch" and "On End Touch" The first one means trigger as soon as someone touches the trigger_multiple. The other one only triggers when you leave it.
Another cool thing - go look at the "Inputs" tab for the ambient generic. If you've set this all up right, you'll see the trigger you created listed in there - so when you've got an entity it's easy to find out what's triggering it and how.
So the dropdowns you get with different trigger inputs and outputs - those change based on what kind of entity is doing the triggering and what kind of entity is being triggered. Lights let you turn them on and off, etc. You can target a trigger_multiple for example, and enable or disable it along with other things.
This whole new scheme for triggering is MUCH more powerful than the old way - and much more versatile. For one thing, it's easy to set up multiple triggers for things (no more multi_managers!). Another thing is because you choose the entity names and triggers to hit via dropdown, it's about impossible to screw up the names.
Oh - i should have mentioned this too. You can have as many outputs on an entity as you want. Each one can be activated via some different method if you want, or you can have a bunch of the same activations targeting different entities (like maybe turn on a light and off a sound). You can also give them each a time delay if you want.
A good example of using multiple triggers. Suppose you want a broken light in a map. It starts dark. There is a switch on the wall (func_button). Create a light and name it like "busted_light". Make it's appearance be "flicker A" and initially dark. Create an env_spark anmed "busted_spark" and set it to initially off. Now set up your func_button. Have it target the light and spark to turn them on when the light is on. Now set up two more outputs for the func_button to target the light and spark off when the button is off. The button will have 4 outputs total (2 for on, 2 for off) and the light and sparker will have two inputs each (one for on, one for off).
By the way, you'll get an icon with a red line through it on an entity's properties dialog if it's got broken inputs or outputs. That tells you that either the entity you're looking at is not triggering something right, or something is not triggering the one you're looking at right.
Report this post to a moderator | IP: Logged
|