I made a map with bus stop objects and other stuff. .. a decent map. But i cant find a tutorial that shows how to setup bus routes. Do i need to program something? Or what? Please help me. Here a the locations:
As many things gameplay-related on this game, the best way to figure out a system is to look for the relevant files in the game files, copy-paste them to your level and edit the fields to adapt it to your level. I order to create a bus route, you'll need 2 things : 1) Create the bus stop triggers In the level editor, you need to place the box that the bus must be in to validate that the bus is parked next to your bus stop. To keep things organised, I advise you create a new folder/simgroup called "busstops" in the level editor. In this folder, you need to place "Lua Trigger" objects (Library tab -> Level tab -> Lua Trigger). Give it a relevant name (ex: busStop_1). You'll then need to scale and place this trigger where the bus needs to be parked. The parameters you'll need are as follow : You can then copy and paste these triggers until you made one in front of every bus stop. 2) Create the bus line In the folder Documents\BeamNG.drive\levels\yourLevelName\buslines (that you'll need to create), you want to make a new file named "yourLevelName.buslines.json". In this file you'll tell the game how to make the bus lines. Here's an example : Code: { "version": 1, "routes":[ {"routeID":"42", "variance":"a", "direction":"theFinalStopName", "routeColor": "#ff8c00", "vehicle" : { "model": "citybus", "config": "city" }, "tasklist":[ "busStop_1", "busStop_2", "busStop_3", ], "spawnLocation": { "pos": {"x": 0,"y": 0,"z": 0}, "rotAngAxisF": {"x": 0,"y": 0,"z": 1,"w": 267} }, "navhelp" : { "busStop_2" : ["helpWaypoint_1", "helpWaypoint_2"], }, "previews":[ "busLinePreviewImage.png" ] }, ] } Some notes on the functions : "routeColor" : Color of your line, in the hexadecimal format "vehicle" : The default bus selected for the line "tasklist" : List of the bus stop triggers needed to cross to complete the bus line "navhelp" : (optional) If the automatic navigation doesn't pick the route you want, you can add waypoints in the level and tell the navigation to show the path to the waypoints then to the bus stop. For example here in between busStop_1 and busStop_2, the navigation arrows will go to helpWaypoint_1, then to helpWaypoint_2 and then to busStop_2, instead of directly from busStop_1 to busStop_2 To add another route, copy-paste everything between {"routeID": and }, just after this curly brace. And your bus route should now be created and working ! If it doesn't work, you can look in the console (search for the binding to bring it up in the controls), it often shows where the error comes from.
Tried it this way. And tried it the copy/paste way. My Map doesn't show up in the bus routes Map Selector. I cleaned Cache and watched for any kind of error in the console. But nothing there. I placed the 'BeamNGTrigger' class Object with Lua Function onBeamNGTrigger. Everything is fine controlled it 1000 times. Do your bus routes work this way at this date? @DaddelZeit which Map has the bus routes on it? //EDIT: Found everything in the new wiki. https://documentation.beamng.com/modding/gamemodes/buslines/ The /scenarios/bus/bus_level.json wasn't there.