See also: multisource
is very useful, and it can be applied to many situations. The concept is simple: it's a trigger that will only activate its target once everything targeting it is active. In boolean logic, it's similar to an 'AND' operator. This tutorial covers two uses: triggering an event, and unlocking a door. To add a bit of variety, we'll make sure the 'event' only happens once, while the door activation can be toggled.
This tutorial is dependent on its example map, so you might want to download it to experiment with.
The Multisource and buttons
See also: func_button
We'll start with the basic
setup. For this tutorial we will use three buttons as our triggers, but you can use any number of any kind of trigger. The
will only trigger its target when all
of the triggers targeting it are active, or 'on'. So, because we're using buttons, we'll need to make sure they stay on long enough for the player to be able to press all three. In the example map, the delay is 13
seconds for each button. In some situations you might want the button to stay pressed forever though.
Each of the buttons must target the same thing. Try beam_multi
is of course the name of the
, which in the example map targets beam_relay
. That's about all there is to it, in fact.
See also: trigger_relay
But let's go a bit further. The beam_relay
that targets beam_manager
. The important thing about this entity is that the flag Remove on fire
is on. If the relay weren't there, once the buttons had reset, they could be turned back on again, and the
would toggle its target off, which we don't want. But because it is
there, after being triggered once, the relay disappears and the link between the
and the main event (beam_manager
) is broken, so beam_manager
cannot be retriggered.
See also: multi_manager
Finally, there is the
that handles the main 'event', which is a sequence of sounds and beams that turn on one after the other. The delays are determined by the values of the keys of the
(turn off SmartEdit
in the Properties
window to see or add custom keys).
See also: func_door
Another important use of
entities is for locking and unlocking doors. In the example map, the door at the far end has been set up with some basic properties. The important one is Master
. Set this to the name of the
in the example map). Now the door will not open unless the
is active. This is a different scenario to event triggering; although the
doesn't actually trigger the door to open, the player cannot open it unless the
is active. So if you press all three buttons and then run to the door, you can get inside, pick up the shotgun and kill Barney. But make sure you get out again before any of the buttons resets, because then the
will turn off, and the door will lock!
See if you can get Barney to follow you out of the enclosure quickly enough, then get him to run into the big red beam. Oops!