Workshop

TrafficWerks 1.0 Free
Install

HELP WANTED! If you are interested in expanding this system or want to edit it in anyway, send me a message/post a comment, and then I can add you as a collaborator.

A vehicle traffic system for Leadwerks!

Important Note: While I am going to try to improve the system and add other features, this isn't the easiest asset to use. It can get quite complicated and there are many things that can go wrong. If you need help setting it up, post a comment or message me and I'll try my best to help. Generally, the most common errors will likely be nil pointer errors in that either a point (i.e. Point67) doesn't exist but something points to it or the global variables either conflict with other global variables you have or have not been initialized (i.e. copied/pasted from the app_dot_lua_header.lua file into App.lua as is said in the instructions below).

Required Workshop Items:
-"Vehicles" by Josh
-"CarDemo prefab (requires addon Vehicles installed)" by shadmar

Key features:
-Almost any type of road imaginable is possible
-Performance stays roughly constant no matter how many roads there are
-Adaptive turning means vehicles are less likely to miss turns
-Vehicles react to obstacles in front of them including other vehicles

Instructions:
-Copy everything in "app_dot_lua_header.lua" and paste it at the top of "App.lua" (above the Start method).
-Drag the prefab car into the scene.
-Make a few pivot points and name them "Pointx" where "x" is a number (i.e. "Point0," "Point1").
-Assign the "point.lua" script to them.
-In each pivot's script tab, change Choice 1. If you want more than one choice in direction, fill in Choice 2 and then Choice 3. These choices should be the number associated to each point (i.e. 1 for Point1, 0 for Point0)
-Create a new pivot and assign it the "carmap.lua" script.
-Make all of your points children of this carmap pivot.
-Make sure you set the "Start Goal" for each car prefab under the script tab.

Information