Skip to main content

Connect

This packet is sent when the player changes a connection between two connection points with the connect tool.

  • ID: 0x2C (44)
  • Size: 9 bytes
  • LZ4 Compressed: Yes
  • State: Playing
  • Bound To: Client -> Server

Structure

OffsetField NameField TypeNotes
0x00Child IDbe u32The ID of the interactable or bearing the connection is made to.
0x04Parent IDbe u32The ID of the interactable the connection is made from.
0x08Flagsu8 bitfieldThe bitfield denoting what type of interaction was made with the connection. See Flags bitfield.

Flags bitfield

note

These two tables document bitfields of the same byte.

Interaction type

BitsField nameNotes
7Unused
6Reverse DirectionSetting this field reverses the direction the bearing spins in, if it exists.
5DisconnectSetting this field destroys the connection between the parent and the child, if it exists.
4ConnectSetting this field creates a connection between the parent and the child, if it does not exist.

Setting both the Connect and the Disconnect bits causes the connection to toggle.

If the Reverse Direction bit is set, the Connect and Disconnect bits are ignored. For parts this means the connection cannot be modified if the Reverse Direction is set, while for bearings the direction is always reversed, regardless of the values of the Connect and Disconnect bits.

If no bits are set, nothing happens.

Child connection type

BitsField nameNotes
3Unused
2
1BearingSet this bit to connect a part to a bearing.
0Standard

Set this bit to connect two parts or a part to a piston.

If this bit it set, the Bearing bit is ignored.

If no bits are set, nothing happens.

warning

If the Bearing bit is set, the Part bit is not set, and the child of the connection is not a bearing, the game will crash!

Validation

If either the parent or child do not exist, nothing happens.

If the parent is a scripted part and the child is a bearing, the server does not validate if connecting parent and child is allowed. The connection will be made or destroyed, regardless of the scripted part's connectionOutput value.

If the child is a bearing, the server does not validate if the child does not already have a parent. This allows for connecting multiple parents to a single bearing. This can be achieved through blueprint editing as well and is persistent through reloads.