Vehicles & Cargo Visuals¶
Vehicles use CargoTransportAgent.
Basic Setup¶
Add CargoTransportAgent to a vehicle object and assign a CargoRoute.
Important fields:
RouteStart Stop IndexMove SpeedRotation SpeedStop DistanceStop Work TimeInventory CapacityLoad Amount Per Cargo
Loading Cargo¶
Each route stop has a Load Mode.
None
: Do not load cargo at this stop.
Load Listed Cargo
: Only load cargo entries from Cargo To Load.
Load Cargo Wanted By Next Stops
: Load cargo that future stops request.
Cargo To Load¶
Each load rule contains:
CargoMax Load AmountLoaded Cargo Visual Prefab
Max Load Amount is the maximum amount of that cargo the vehicle should carry. If the node has less than the max amount, the vehicle loads the available amount.
Note
Load Amount Per Cargo on the vehicle is also part of the load limit. The loaded amount is limited by available cargo, free vehicle capacity, max load amount, and load amount per cargo.
Unloading Cargo¶
Each route stop can unload cargo in two ways:
Unload Cargo Wanted By NodeCargo To Unload
Cargo To Unload entries include:
CargoUnload Percent
Use unload percent when a stop should unload only part of the cargo carried by the vehicle.
Cargo Visual Mode¶
CargoTransportVisualMode controls how cargo visuals appear.
None
: Hide loaded cargo visuals.
Trail Behind
: Place cargo visuals behind the vehicle, useful for train wagons.
Attach To Root
: Attach cargo visuals to the vehicle root, useful for ships and planes.
Visual Prefab Priority¶
When cargo is loaded, the visual prefab is selected in this order:
Cargo To Load > Loaded Cargo Visual Prefab- Route stop
Loaded Cargo Visual Prefab - Vehicle
Fallback Loaded Cargo Visual Prefab