Connectors

From C4 Engine Wiki

(Redirected from Using Connectors)
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

Figure 1. Connectors can be added or removed from a node under the Connectors tab in the Node Info window.
Figure 1. Connectors can be added or removed from a node under the Connectors tab in the Node Info window.
Connectors are added to (or removed from) a node under the Connectors tab in the Node Info window (shown in Figure 1). Each connector has a name of up to 15 bytes in length 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 and type in an identifier for the new entry that appears in the list of connectors.



Built-in Connectors

Some node types have built-in connectors that can activated under the Connectors tab of the Node Info window. As shown in Figure 1, a list of built-in connectors is displayed on the left side of the window (empty in this case). Selecting an available built-in connector and clicking on the Assign button causes the connector to appear in the assigned list. Connectors in the assigned list will show up in the editor as connector boxes that can be linked to other nodes. The names of built-in connectors always begin with a percent character (%).

The following table describes the built-in connectors for each type of node that defines them.

Node Type

Connector

Usage

Zone

%Fog

Connected to a fog space to indicate that a particular fog space should be used in the zone.

Zone

%Acoustics

Connected to an acoustics space to define the acoustical properties of the zone.

Zone

%Ambient

Connected to an ambient space to indicate that a particular ambient space should be applied to geometries in the zone.

Portal

%Zone

Connected to a zone to specify the destination of the portal. This connector is assigned by default when a new portal is created.

Light

%Shadow

Connected to a shadow space to specify the maximum bounds of shadows cast by the light.

Particle System

%Emitter

Connected to an emitter for use by the particle system.

Joint

%Body1, %Body2

Connected to nodes that are constrained through the physics joint.

Cloth Geometry

%Wind

Connected to a field with a wind force assigned to it to indicate that the wind should affect the cloth simulation.

Geometry

%Paint

Connected to a paint space to indicate that the geometry's material should use a particular paint texture. This connector is automatically created when a geometry is associated with a paint space using the command in the paint page, so it wouldn't normally need to be added manually.

Path Primitive, Tube Effect

%Path

Connected to the path that defines the shape of the geometry or effect.


Connecting to Other Nodes

Figure 2. When the Connect tool is selected in the World Editor, the connectors belonging to the selected node are displayed in a list beneath the node in all of the orthographic viewports. This screenshot shows a list of connectors belonging to a trigger node.
Figure 2. When the Connect tool is selected in the World Editor, the connectors belonging to the selected node are displayed in a list beneath the node in all of the orthographic viewports. This screenshot shows a list of connectors belonging to a trigger node.
Each connector can be either unconnected or connected to one node. To specify the target of a connector, click on the 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 a list beneath the selected node, as shown in Figure 2. Click in a box to select a connector, and it will be highlighted 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 line with arrowheads pointing from the connector to its target node. (This line is white for the selected connector and orange for unselected connectors.) 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).


See Also