Skip to content

AddCartRoute

Makes a route and sets its carts going.

route is a table: name (1-32 letters, digits, spaces and -_.'), points - the road as a list of {x, y, z} (or {x = , y = , z = }; a z left out or below 0 is the ground’s), at least two points and 10 m of road - mode ("loop", the default: from the last point back to the first; "back": to the last point and back again, turning round at both ends), speed (m/s; nil = [carts] speed), carts (how many drive it, spread evenly; 1), kind ("wagon" or "cart"), driver (false = no wagoner on the bench), driverSoul (the wagoner’s soul; "" = a villager’s), parts (what its carts look like, as SetCartParts takes it) and stops: a list of {point = , name = , wait = } - point the number of the point in points it stands at (from 1), wait seconds (30). The corners are rounded over a few metres. A route of the same name is replaced; its carts move onto the new road and take its parts (of another kind, new carts take their places). The route lasts until the server stops - SaveCartRoutes writes it into the routes file.

AddCartRoute(route)
Parameter Type
route table {name =, points =, mode =, speed =, carts =, kind =, driver =, driverSoul =, parts =, stops =}

boolean - false when the route makes no road, its name is not one, or carts are off

AddCartRoute({
name = "Monastery loop",
points = {{1284, 1080}, {1244, 1080}, {1244, 1106}, {1284, 1106}},
speed = 6,
parts = {body = "c", load = "hay_small"},
stops = {{point = 1, name = "Monastery gate", wait = 20}},
})

GetCartRoutes · RemoveCartRoute · SaveCartRoutes · SetCartRoute · OnCartStop · the Carts group of the index