Route Creation

Here is a walk through of how to create a new route

Step 1 - Add your new route to your config

You add the new route into the config's list by using the template below:

```lua
["111"] = { 
			label = Lang['route_number_menu'],
			description = Lang['route_desc_111'], 
			icon = 'route',
			VehicleModel = 'pc-coach',
			SpawnLocation = vector4(457.27, -654.26, 27.94, 215.0),
			LiveryNumber = {enable = true, option = 1},
			RoofLiveryNumber = {enable = true, option = 7},
			ExtraNumber = {enable = false, option = 6},
			PlatformNumber = 1,
			Tier = 8,
			RouteNumber = 111,
			ServiceType = Lang["route_type_express"],
			StartingBusStop = Lang['next_busstop']:format("Example Road"),
		},
```

In the above example 111 is the route number that will need changing to the new route number. If you have multiple routes with the same number it may break the script.

Step 2 - Adding the route description

In the language.lua file you will find a route description section add the routes description into there using this as a template:

['route_desc_111'] = "Example Road - Test Facility via Humane Labs",

Step 3 - Creating the route

Go into client > customize.lua and go to the bottom of the route entries to start creating a new route:

```lua
{
			Pos = Config.Route["576"].SpawnLocation,
			StopType = 'depo',
		}, -- This is the end of the last route in the route table. Add new route below
["111"] = { -- Example route number
		{
			Pos = vector4(439.92, -673.93, 28.77, 92.4),
			StopType = 'checkpoint',
			SetCurrentZoneType = 'town',
		}, -- This is the first checkpoint. I would recommend to have this near the exit of the bus depo/ station.
```

After the first entry is done you now need to add any checkpoints or bus stop's as you go through the route:

```lua
{
			Pos = vector4(74.55, -622.81, 31.57, 160.37),
			StopType = 'checkpoint',
		},
		{
			Pos = vector4(-624.44, -604.55, 33.49, 0.3),
			StopType = 'checkpoint',
		},
		{
			Pos = vector4(-676.93, -475.45, 34.38, 86.89),
			StopType = 'checkpoint',
			SetCurrentZoneType = 'freeway', -- at this checkpoint it will set to freeway speed limit
		},
		{
			Pos = vector4(-2118.98, -353.08, 13.05, 66.75),
			StopType = 'checkpoint',
			SetCurrentZoneType = 'town', -- at this checkpoint it will set to town speed limit
		},
		{
			Pos = vector4(-2118.57, -242.09, 16.29, 322),
			StopType = 'busstop',
			BusStopName = "West Eclipse Blvd", -- This is used for the next bus stop notification
			SetCurrentZoneType = nil, 
		},
```

The position (Pos = coords) is the location in the world including rotation where you wish to put the checkpoint or bus stop markers.

When you are on your last bus stop of the route before you return to the depo/ station your bus stop should look like this:

```lua
{
			Pos = vector4(-1881.43, -380.28, 48.39, 49.86),
			StopType = 'busstop',
		},
```

You can add checkpoints after this last bus stop entry to help return the driver to the bus depo/ station if you wish.

Adding the depo is simple it is the last entry in the route list. It should look like this:

```lua
{
			Pos = Config.Route["111"].SpawnLocation,
			StopType = 'depo',
		},
```

Example of a full route used in the pc-busjob script:

```lua
["45"] = {
		{
			Pos = vector4(439.92, -673.93, 28.77, 92.4),
			StopType = 'checkpoint',
			SetCurrentZoneType = 'town',
		},
		{
			Pos = vector4(308.986542, -764.5427, 29.2762642, 160.0),
			StopType = 'busstop',
			BusStopName = "Legion Square"
		},
		{
			Pos = vector4(246.435181, -939.530334, 29.2637, 160.0),
			StopType = 'busstop',
			BusStopName = "Strawberry"
		},
		{
			Pos = vector4(206.004578, -1209.05347, 29.1812553, 186.0),
			StopType = 'busstop',
			BusStopName = "Strawberry Ave"
		},
		{
			Pos = vector4(-105.806969, -1686.104, 29.2484436, 141.0),
			StopType = 'busstop',
			BusStopName = "Maze Bank Arena"
		},
		{
			Pos = vector4(-337.8374, -1815.35, 22.6785, 87.0),
			StopType = 'busstop',
			BusStopName = "New Empire Way"
		},
		{
			Pos = vector4(-1008.36676, -2472.36865, 13.7148781, 150.0),
			StopType = 'busstop',
			BusStopName = "L.S.I.A."
		},
		{
			Pos = vector4(-1043.51257, -2717.055, 13.7227144, 240.0),
			StopType = 'busstop',
			BusStopName = "Maze Bank Arena"
		},
		{
			Pos = vector4(-299.390472, -1842.98364, 25.5925026, 265.0),
			StopType = 'busstop',
			BusStopName = "Dollar Pills"
		},
		{
			Pos = vector4(49.1038055, -1536.545, 29.225462, 320.0),
			StopType = 'busstop',
			BusStopName = "Strawberry"
		},
		{
			Pos = vector4(230.8047, -1198.669, 29.25237, 8.0),
			StopType = 'busstop',
			BusStopName = "Legion Square"
		},
		{
			Pos = vector4(278.469543, -914.7581, 28.9543018, 340.0),
			StopType = 'busstop',
		},
		{
			Pos = Config.Route["45"].SpawnLocation,
			StopType = 'depo',
		},
	},
```

How to create new YMAP routes

To create a route with some new bus stop props (i.e. signs, shelters or other props you wish to use) you have to create a new .ymap file to add into a stream folder of a resource (i would recommend the pc-busjob-maps that comes bundled with the pc-busjobs script) for it to be loaded. If you don't know how to create a new .ymap this I would recommend following this video below done by Otto Mapping.

Last updated