Skip to content
WhistleWiz edited this page Feb 20, 2024 · 30 revisions

Before you start

With the update to Simulator, CCL is now more complex and powerful than ever. If you are not familiar with Unity concepts, you are strongly encouraged to watch tutorials on how the Unity Editor works.

Custom Car Crash Course

The car template and exporter Unity package is available in a zip file under releases. If you need to install the Unity Editor, use version 2019.4.40 (do NOT use one of the 2020 or newer versions, this could cause compatibility issues). You will have to look into the previous releases archive on the Unity site in order to find the correct version.

The following steps assume that you've installed the Unity Editor and have created a new project.

Important

Make sure your Unity version is 2019.4.40!

Caution

Having your mesh or materials named the same as the car prefab can cause a conflict when loading the car into the game. Make sure to use different names for your assets and prefab!

Project setup

  1. Open the Project Settings, then the Player tab. In the Other Settings dropdown, change the color space to Linear. Afterward, go to the XR Settings dropdown and set Virtual Reality Enabled to true, and Stereo Rendering Mode to Single Pass.

  2. Import CarCreator.unitypackage into your project (right-click on your Assets folder in the Project tab and select Import Package > Custom package...).

You should now have a folder called "CarCreator" under your project Assets, and a CCL tab in the menu bar.

Car creation

  1. Under the CCL tab should now have a new option: Create New Car Type. Click this button to launch a car creation wizard window. Fill out the fields as prompted, and once finished, click the "Create Car" button to proceed.

Car Wizard

  1. The wizard will have created several new assets in a new folder under _CCL_CARS, and selected the scene and car type for you:

Wizard Results

  • A CustomCarType asset (MyCar_cartype.asset)
  • A CustomLivery asset (MyCar_livery.asset)
  • A main car prefab (MyCar_template.prefab)
  • An interactables prefab (MyCar_interactables.prefab)
  • A scene containing an instance of the main prefab and interactables prefab (MyCar_create.scene)
  1. Now you can modify your car object to align with your vision. Make sure you are modifying the prefabs and not just the objects in the preview scene! You'll likely want to replace the meshes first; the template is set up with a simple cube in place of the car body. Next, you can align your bogies, couplers, chains, etc. so that they match your new mesh. After aligning the bogies, make sure the bogie colliders match the positions of the bogies (see the Bogies and Colliders pages for more details). For the interactables prefab, you can move around the brake wheels and release lever, the simple models will be replaced with the real models when loading into the game.

Exporting

  1. Select your car type asset from the project pane and modify its properties to your liking. Once finished, click the Export Car button at the bottom of the inspector. This will bring up the car validator which will run some basic checks on your car structure. If any issues are found, they will be indicated here. Click Continue Export to proceed to the final export window.

Car Validator Export Window

  1. Click "Export Train Car" once you are ready to export. You can read [HOW TO EXPORT] or [HOW TO AVOID ERRORS] within the window if you are having any trouble. You can check "Open build folder after export" if you want to see the results of the export.

  2. The export window should open to your Derail Valley directory if it exists within the C:/ drive. If not, navigate to your Derail Valley install location and find the UMM mods folder: ...steamapps/common/Derail Valley/Mods/

  3. Create a new folder inside of the Mods folder to hold your new car. (You can reuse the same folder if this is not the first time exporting; be careful to not accidentally clear the previous contents if you don't want that!). Make sure you select or open the folder for your car and that the name is displayed in the bottom of the selection dialog.

Caution

Make sure you are exporting to the correct folder!

Select Folder

The export process might take a minute or so to complete. Once your car is finished exporting though, it is ready to use inside of Derail Valley! It can be spawned using the car spawner mode of the comms remote - make sure it is enabled in the ESC menu settings.

Tip

You can export multiple cars into subfolders to ship them as a single mod.

image

Car Structure Overview

Gauges

Track Gauge

Derail Valley tracks use standard gauge (1435mm). You can use mods to change it, but you'll still need to make your car's wheels match standard to work properly.

Loading Gauge

Depending where you are on the map, the amount of space you have for a wagon changes, however there are still good limits to follow if you wish your custom cars to be compatible with most of the map. Below is a diagram with safe measurements.

image

A car that is at most 3.7m wide and 5m tall will fit everywhere in the valley (except Sawmill, which has a height limit of 4.5m on one of its yards but that will be raised in the future).

Catenary will be at a height of 6m, so you should still strive to be below that value.

Tunnels have a height at the centre of 7m, however they are oval in shape. You should completely avoid the red area.

For width, passenger platforms are at a distance of 3.7m from eachother (and a height of 1m). Above that value, you can exceed the width for up to 4.3m, at which point trackside objects (like yard lamps) will block your way.

Tip

Most vanilla rolling stock has a max height of 4m and max width of 3.2m.

Clone this wiki locally