Using Connectors

From C4 Engine Wiki

Jump to: navigation, search

Every node in a world can have one or more connectors attached to it. A connector forms a link between the node that owns it and some other node in the world. Connectors are used for a variety of different purposes such as connecting a portal to the zone that it leads to or connecting a node with a script controller to other nodes that the script affects.

Creating Connectors

Connectors are added to (or removed from) a node under the Connectors pane of the node's Get Info dialog (shown to the right). Each connector has a four-character code that is used to identify it. This identifier is displayed in the World Editor and the Script Editor to distinguish among different connectors attached to a node. To add a new connector to a node, simply click the New button under the Connectors pane and type in an identifier for the new entry that appears in the connector list.

Each connector may also have a node type associated with it. In the connector list shown in the Connectors pane, each connector has a popup menu next to it from which you may choose a specific node type. When a connector has a node type associated with it, the World Editor will only allow it to be connected to nodes of that type. This function exists only to give level designers a hint about what type of node the connector is intended to be used with.

Connecting to Other Nodes

Each connector can be either unconnected or connected to one node. To specify the target of a connector, click on the Select and Connect tool (or press 5) and then select a node for which you want to set an outgoing connection (but don't select the target yet). The available connectors will appear in little boxes containing their identifiers with icons showing what types of node they can be connected to, as shown in the image to the right. Click in a box to select a connector, and it will change color and get a thicker outline to indicate that it's selected. Then select the target node and choose Connect Node from the Node menu (or just hit Ctrl-L). You will see a yellowish line with arrowheads pointing from the connector to the center of its target. Connectors from multiple nodes (one connector each) can be selected by using the shift key. This can be useful if, for instance, you want to connect multiple zones to the same fog space.

A connector can be broken by selecting it and choosing Unconnect Node from the Node menu (or hitting Ctrl-U).

Built-in Connectors

Some node types have built-in connectors that cannot be removed.

  • A zone has three connectors: one called FOG that connects to a fog space, one called AMBT that connects to an ambient space, and one called ACST that connects to an acoustics space.
  • A portal has one connector called ZONE that connects to the portal's destination zone.
  • A light has one connector called SHAD that connects to a shadow space.
  • A trigger has one connector called TARG that can connect to any type of node.
  • A particle system has one connector called EMIT that can connect to an emitter volume.
Personal tools