CartTrain
Host-only cart trains with vanilla-client support. Snap large carts into a physically tethered train without requiring other players to install the mod.CartTrain
CartTrain is a host-only R.E.P.O. mod that connects large carts into a single-file train. Only the lobby host installs it; vanilla players can join normally and see the carts move through the game's existing cart synchronization.
How to use
Push the front of one large cart into the handle end of another. When the leading cart's handle and the following cart's front are nearly touching and the carts face roughly the same direction, they snap together automatically. A physical spring tether runs from the leading cart's real handle point to the following cart's front and maintains a one-metre gap, while virtual track guidance keeps the follower centered and aligned on the route taken by its leader.
Each active joint has a solid light-red tether visual. It follows the real handle-to-front anchors, hangs with a small natural sag, and disappears when the carts detach. The visual does not change the underlying cart physics.
Each handle can connect to one following cart, and each front can connect to one leading cart. A three-cart train is therefore Cart 1 handle to Cart 2 front, followed by Cart 2 handle to Cart 3 front.
While actively grabbing a large cart, the host can press X to isolate that cart. Its connection to the cart ahead and its connection to the cart behind are both removed. The host's CartTrain HUD appears above the inventory slots for five seconds whenever the host begins grabbing a cart.
The host can also release a cart by pulling it away from the train. Vanilla players do not have CartTrain input code, so grabbing a connected follower for the configured short delay releases its incoming tether automatically. This prevents the host's train physics from fighting a vanilla player's grab.
If a connected cart leaves the ground and begins falling, the host automatically removes both of that cart's links. A short delay and downward-speed threshold prevent ordinary ramps, slopes, and small bumps from breaking the train.
Configuration
After launching the game once with the mod installed, edit:
BepInEx/config/GrimDinosaurs.CartTrain.cfg
AutomaticSnapDistance: how close the front/back connection points must be before snapping; defaults to0.45metres.ConnectedGap: spacing between connected cart bodies; defaults to1metre.MaximumSnapAngle: prevents sideways or backwards carts from linking accidentally.MaximumFollowSpeed: maximum follower movement speed.MaximumTurnSpeed: maximum follower turn speed.TetherSpringandTetherDamper: physical front-to-back tether tuning.PathStrength,PathDamping, andRotationStrength: virtual track guidance tuning.DetachKey: key used to detach both sides of the cart you are grabbing; defaults toX.ConnectedCartCollisions: allows directly connected carts to collide; defaults totrue.PullDisconnectStretch: extra stretch that triggers pull-to-release; defaults to0.3metres beyond the normal tether length.VanillaGrabDisconnectDelay: delay before a follower grabbed by a vanilla player releases from its leader; defaults to0.6seconds.DisconnectWhenFalling: enables automatic fall safety; defaults totrue.FallDisconnectDelay: unsupported falling time before disconnection; defaults to0.25seconds.FallSpeedThreshold: required downward speed; defaults to1.5metres per second.
Host-only multiplayer
Only the lobby host should install CartTrain. Version 1.3.0 does not send any custom CartTrain Photon RPCs, so vanilla clients do not need the mod and do not receive missing-RPC errors. The host owns all connection state and follower physics; R.E.P.O.'s existing cart networking synchronizes cart movement to the other players.
Vanilla players see and interact with the carts, but they do not see the light-red tether or CartTrain HUD and cannot use the X keybind. Those custom visuals and controls exist only on the host's game.
Installation
Install on the lobby host with a Thunderstore-compatible mod manager, or place CartTrain.dll in the host's:
R.E.P.O/BepInEx/plugins/GrimDinosaurs-CartTrain/
Current status
Version 1.3.1 automatically isolates a genuinely falling cart so it cannot pull the rest of the train over an edge. Version 1.3.0 introduced host-only compatibility. Link state, HUD, tether visuals, and custom controls remain local to the host; vanilla clients receive only normal game cart movement.
Changelog
1.3.1
- Automatically disconnects a falling cart from both sides.
- Requires no ground support, sufficient downward speed, and a short continuous fall delay.
- Added configurable fall detection thresholds to avoid false releases on ramps and bumps.
1.3.0
- Converted CartTrain to host-only operation with vanilla-client support.
- Removed every custom CartTrain RPC and remote snapshot broadcast.
- Kept link state, physics, HUD, tether visuals, and controls local to the host.
- Added automatic release after a vanilla player grabs a connected follower for a short configurable delay.
- Made the mod inactive on non-host players if they install it unnecessarily.
1.2.8
- Fixed rear carts failing to pull-release because the spring prevented enough measured stretch.
- Detects a short sustained pull away using the local grabber's applied force and relative cart velocity.
- Allows the host to honor the deliberate pull request without rechecking the unreachable stretch threshold.
1.2.7
- Added automatic pull-to-release for grabbed carts.
- Breaks the incoming tether after
0.3metres of extra stretch by default. - Synchronizes pull-release requests through the multiplayer host.
- Keeps
Xas the control for isolating the held cart on both sides.
1.2.6
- Added mass-aware critical damping to physical tethers so they do not store and release excessive bounce energy.
- Cancels inward tether velocity when a manually pulled follower is released.
- Temporarily limits route correction and turning acceleration after release for a smooth return to formation.
1.2.5
- Enabled collision between directly connected carts by default.
- Enabled continuous dynamic collision detection to prevent fast-moving carts from tunneling through each other.
- Increased Rigidbody position and velocity solver iterations.
- Increased safe depenetration speed so overlapping carts separate instead of remaining wedged.
1.2.4
- Added a solid light-red tether visual between every connected cart pair.
- The visual follows the real handle-to-front anchors with a small natural sag.
- Kept the visual static and understated, without the previous glow or energy pulse.
1.2.3
- Anchored the leading side of every joint to the cart's real
handlePointtransform. - Anchored the other side to the following cart's physical front.
- Matched recorded-path spacing to the actual handle-to-front geometry.
1.2.2
- Limited the held-cart HUD to five seconds after grabbing begins.
- Moved the HUD above the inventory-slot buttons.
1.2.1
- Added a configurable held-cart detach key, defaulting to
X. - Detaching isolates the grabbed cart by removing both its front and rear links.
- Added a HUD showing connection state, train position, and detach instructions.
- Synchronized detach requests through the multiplayer host.
1.2.0
- Added a physical
SpringJointtether between each leader's rear and follower's front. - Enforced the configured one-metre connector gap.
- Replaced loose velocity chasing with force-based virtual track guidance.
- Added lateral correction and recorded-route rotation alignment.
- Added initial alignment validation to prevent incorrect side connections.
- Added a v1.1.3 source checkpoint and one-command restore script.
1.1.3
- Moved cart discovery to a
PhysGrabCart.FixedUpdatepostfix. - Switched authority checks to
SemiFunc.IsMasterClientOrSingleplayer(). - Switched follower motion from forced Rigidbody poses to velocity and angular velocity control.
- Pauses follower control while a player directly pulls that follower.
1.1.2
- Fixed large carts not entering the connection registry in single-player when Photon assigns a zero network View ID.
- Added cart-tracking log messages for easier diagnosis.
1.1.1
- Removed the synthetic rear button and key interaction.
- Corrected the cart model's physical front/back orientation.
- Added automatic front-to-back snapping on contact.
- Set the connected cart gap to one metre.
1.1.0
- Added visible rear connection buttons.
- Added configurable
Xinteraction. - Added two-metre connector search and validation.
- Added directed cart chains with cycle prevention.
- Added recorded-path following for corners and slopes.
- Added host-authoritative multiplayer link synchronization.
