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
Offset | Field Name | Field Type | Notes |
---|---|---|---|
0x00 | Child ID | be u32 | The ID of the interactable or bearing the connection is made to. |
0x04 | Parent ID | be u32 | The ID of the interactable the connection is made from. |
0x08 | Flags | u8 bitfield | The bitfield denoting what type of interaction was made with the connection. See Flags bitfield. |
Flags bitfield
These two tables document bitfields of the same byte.
Interaction type
Bits | Field name | Notes |
---|---|---|
7 | Unused | |
6 | Reverse Direction | Setting this field reverses the direction the bearing spins in, if it exists. |
5 | Disconnect | Setting this field destroys the connection between the parent and the child, if it exists. |
4 | Connect | Setting 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
Bits | Field name | Notes |
---|---|---|
3 | Unused | |
2 | ||
1 | Bearing | Set this bit to connect a part to a bearing. |
0 | Standard | Set this bit to connect two parts or a part to a piston. If this bit it set, theBearing bit is ignored. |
If no bits are set, nothing happens.
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.