-
Notifications
You must be signed in to change notification settings - Fork 6
Home
The car template and exporter Unity package is available in a .7z (7-zip) file under releases. If you need to install the Unity Editor, version 2019.2.21 or 2019.4.22 is recommended (do NOT use one of the 2020 or newer versions, this could cause compatibility issues).
Freznosis has made a video demonstration of the export process using the original car loader package.
Original notes: "(BEWARE: Video is unedited, I don't have the time to edit it. It is also missing some of the popup windows, but they are self explanatory.)"
-
Open your Unity project. Import CUSTOM_CAR_LOADER.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 DVCustomCarLoader under your project Assets. The most important folders you'll need to be familiar with are Prefabs and _CARS. To begin creating your model, create a new folder under _CARS with the name of your custom car. This will be your main "workspace" for the car. Right click the new folder in the tree or open it and right click in the asset thumbnail panel, and select Create > Scene from the menu.
- Open your newly created scene (you can delete or leave the default camera and light objects, they won't affect anything). Open the Prefabs folder in the Project/assets panel and drag car_template into the scene. The transform of the new car_template in the scene should be at the origin (zero position), default rotation (all zero angles), with a scale of one in each direction.
-
Right click the car_template you just created in the scene and select Unpack Prefab Completely. This will make sure that the template is preserved for the future. Once unpacked, rename the car_template root transform in the scene to any name that describes your car (this won't be the final name of the car in-game).
-
Now you can modify your car object to align with your vision. You'll likely want to replace the meshes first; the template is set up with several different LOD meshes, which can be deleted if you only have a single level of detail (The LODs are managed by an LODGroup component on the root transform). Next, you can align your bogies, couplers, chains, etc. so that they match your new mesh. After aligning the bogies, click AlignBogieColliders on the TrainCarSetup script (on the root transform of your model) to make sure the bogie colliders match the positions of the bogies (see the Bogies and Colliders pages for more details).
-
Once you've aligned things to your liking, turn your car into a prefab by dragging the root of the object from the scene hierarchy into your workspace folder in the project view. If successful, your object should turn blue in the scene hierarchy. Select the root object in the scene again, and under the TrainCarSetup component click CreateAssetBundleForTrainCar.
-
Right click the TrainCarSetup component and click Prepare for Export. This will bring up a new tool window. Click Prepare TrainCar for Export to proceed.
-
Setup your settings for the car.
- Identifier is the name of your car.
- Type of car is the underlying type of car. Pick the type that matches your car the closest.
-
Click "Finalize TrainCar settings" once you are done entering your new car's info. You can read [HOW TO EXPORT] or [HOW TO AVOID ERRORS] within the window if you are having any trouble. Finally, click Export Train Car to proceed to the last step.
-
The export window should popup to your games directory if it exists within the C:/ directory. If not, navigate to your Derail Valley install location and find the custom cars folder:
.../Derail Valley/Mods/DVCustomCarLoader/Cars/ -
Create a new folder inside of the Cars folder to hold your new car. (You can reuse the same folder if this is not the first time exporting; the previous contents will be cleared though!). Make sure you select or open the folder for your car and that the name is displayed in the bottom of the selection dialog.
- Once your car is finished exporting it is ready to use inside of Derail Valley! It can be spawned using the new mode on the Comms Remote.