半条命地图吧 关注:134贴子:2,404
  • 3回复贴,共1

【英文教程】Multisource实体的用法

只看楼主收藏回复

This tutorial is primarily about the multisource, but it also covers lots of other stuff that is used in the example map because I happened to be bored when I made it.
Setup
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 everthing 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
The Multisource and Buttons
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 targetting 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 multisource, which in the example map targets beam_relay. That's about all there is to it,
in fact.
Event 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 events
The Event
Finally, there is the multimanager 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 themultimanager (turn off SmartEdit in the Properties window to see or add custom keys).
Multisource Doors
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 result


IP属地:湖南1楼2014-11-19 17:43回复
    就不能用自己的话概括吗


    IP属地:广东来自Android客户端3楼2014-11-22 23:50
    回复
        我激动得忍不住就在屏幕前流下了眼泪。是啊,只要在楼主的带领下,社区就有希望了。


      5楼2015-10-27 14:54
      回复