Dispatchers

Prerequisites:
Intro to Triggers

Overview:
What's a Dispatcher and why would you want to use it?  A Dispatcher lets you fire off a series of events with delays between each.  It's also handy if you just want to pause a certain amount of time before a single event is fired.  Up to eight events can be fired.

Why would you use them?  You might want to set up a fancy sequence of doors opening, or you might want to have an elevator go to a certain floor, open some doors, then play a sound effect.  Or you might want to have an AllianceTrigger fire some time after another event.  There are all kinds of things you can do.

Download:
Example map (6K)

 

1. Place your Dispatcher

First, build a basic room and stick a light and a PlayerStart it in.  Rebuild.  Now go to the Class browser and select Dispatcher under Triggers.

Point at your room's floor and hit the "A" key.  The Dispatcher will look like this in the editor:

 

2. Set its properties

We're going to fire off three different events in a row, with a one second pause between each one.  Expand Dispatcher -> OutDelays and set [1] to 1.0 and [2] to 1.0.  Leave [0] as 0.0.  What the heck does all of that mean?  It means that there will be no pause before the first event, a one second pause before the second event, and a one second pause before the third event.

Now expand Dispatcher -> OutEvents and fill in the following values for the first three items: one, two, three.  These would of course have more meaningful names in the context of a real map.

Finally, set the Dispatcher's Events -> Tag value to dispatcher1.

NOTE: A Dispatcher won't draw any red lines to the things it will trigger.

 

3. Set up stuff to trigger

We set up the Dispatcher to fire off events called one, two, and three, but there's nothing with those Tag values in the map.  Time to fix that.  Add three or more of anything you want to trigger and set their Tag values to one, two, and three.

In my example map, I added three TriggerLight's (with their Object -> InitialState values set to TriggerToggle), as well as three SpecialEvent triggers to play sound effects.

 

4. Add a regular trigger

Bet you thought you were done, huh?  Not quite.  Dispatchers can't be triggered by running into them, so we still need a way for the Dispatcher itself to get triggered.  So add a regular trigger to your map and set its Events -> Event value to dispatcher1.  You should see a red line from the trigger to the Dispatcher.  Now when you run into the regular trigger, the Dispatcher will get fired and the one, two, and three events will be generated.

 

5. Try it out

Try out your map.  If you want to try the example map, step inside the circle, and the lights and sound effects will get fired in sequence.  Step outside of the circle and then back in, and the lights will turn *off* in sequence.


Back to main page