Tutorial: Multisource Last edited 6 months ago2024-06-19 11:01:10 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
Download example map

Multisource introduction

See also: multisource

The 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.
Diagram of multisource concept, with comparison to logic AND gateDiagram of multisource concept, with comparison to logic AND gate

The Multisource and buttons

See also: func_button

We'll start with the basic multisource setup. For this tutorial we will use three buttons as our triggers, but you can use any number of any kind of trigger. The multisource 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. beam_multi is of course the name of the multisource, which in the example map targets beam_relay. That's about all there is to it, in fact.

Event relay

See also: trigger_relay

But let's go a bit further. The beam_relay is a trigger_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 multisource 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 multisource and the main event (beam_manager) is broken, so beam_manager cannot be retriggered.
Diagram of chain eventsDiagram of chain events

The event

See also: multi_manager

Finally, there is the multi_manager called beam_manager 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 multi_manager (turn off SmartEdit in the Properties window to see or add custom keys).

Multisource doors

See also: func_door

Another important use of multisource 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 multisource (beam_multi in the example map). Now the door will not open unless the multisource is active. This is a different scenario to event triggering; although the multisource doesn't actually trigger the door to open, the player cannot open it unless the multisource 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 multisource 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!
The final resultThe final result

1 Comment

Commented 11 years ago2013-06-12 19:34:00 UTC Comment #100492
This helped me a lot! Thank you.

You must log in to post a comment. You can login or register a new account.