Sequencers


Note: This page contains five applets. It can take some time to load all the applet artwork. If one of the applets appears not to be running, probably this is because the artwork has not finished loading yet.

When a Hyperwire title runs, many of its responses to events are direct and immediate. A button turns something on or off, or the text a user enters appears in a label, and so on. Sometimes the response to an event needs to be more elaborate, and for some titles, you will need to control the sequence in which responses happen. To mention a very simple example, you might want to display images as slides, in one particular order and no other.

To control the order in which modules are activated, Hyperwire provides five kinds of modules called sequencers. A sequencer is a nonvisual module whose purpose is to control the order in which other modules activate while the applet runs. Sequencers help you create more complex responses to user events than simple on/off responses.

In general, a sequencer controls other modules via numbered outputs found on the Custom Outputs submenu. Number of Outputs is a module-specific property for sequencers. You set it to equal the number of modules you want the sequencer to control. For example, a Simple Sequencer module has Number of Outputs set to 3 by default, so by default it has three custom output ports called 1, 2, and 3. If you wanted the Simple Sequencer to control five modules instead, you would change Number of Outputs to 5, and the Custom Outputs menu would then show five ports numbered 1 through 5. (You can also change the number that begins the sequence; for example, to make the ports be labeled 0 through 4.)

A sequencer's input ports and the sequencer type determine how and in what order the sequencer triggers its numbered ports.

Note: There are exceptions to the general model of how sequencers work. Time Sequencer outputs are driven by a list instead of simple numbered outputs, and Exclusive Switch modules have additional custom outputs besides the basic numbered 1, 2, 3, ... outputs.

Sequencers are grouped into the Sequencers folders on the Modules menu (Modules/Sequencers). The following sections describe each type of sequencer.


Simple Sequencer

A Simple Sequencer module steps through its numbered outputs one at a time. Its inputs can tell it to step forward or backward, or reset it to the start of its sequence. The sequence can be set to loop. (The sequencer in the sample applet does not loop.)

Applet

Simple sequencers are good for letting the user step through a fixed sequence of occurrences, as in the slide-show example shown in exercise 4.


Fan-Out Sequencer

A Fan-Out Sequencer module broadcasts one event to several modules by triggering all of its output ports in rapid succession. Usually it appears as if all the modules it activates were activated simultaneously.

Applet

Fan-Out Sequencers can help simplify wiring, when one event must trigger several modules.

Exercise 8 contains an example of using a Fan-Out Sequencer.


Random Sequencer

A Random Sequencer module chooses one of its output ports at random, and triggers it. You can also tell it to trigger the ports that it didn't choose.

Applet

Random Sequencers can be useful in game titles.


Exclusive Switch

An Exclusive Switch module is a sequencer that ensures only one of the modules it controls is active at any given time. When it turns on one module, it turns off the previously active one.

Applet

Exclusive Switches are useful for titles that give the user several mutually exclusive interfaces or subtitles to choose from.


Time Sequencer

A Time Sequencer module triggers its outputs according to a list that includes a timed schedule. The Time Sequencer in the sample applet is set to loop.

Applet

The interface of a Time Sequencer module differs from other sequencers. Like a visual container, its icon has an Open button.



When you open the Time Sequencer, you see an editor for a list of output events.



Each line in the list defines a time for the event to happen. This is time elapsed since the Time Sequencer itself is triggered. Each unique Output name defines a custom output port for the Time Sequencer module. A wire from this output port is triggered when the elapsed time is reached. The sequence can be set to loop.

Home | Previous | Next