# Guide to adding new content to CDDA for first time modders

**URL:** https://discourse.cataclysmdda.org/t/guide-to-adding-new-content-to-cdda-for-first-time-modders/17781
**Category:** The Lab
**Created:** [December 7, 2018, 5:53pm UTC](https://discourse.cataclysmdda.org/t/guide-to-adding-new-content-to-cdda-for-first-time-modders/17781 "2018-12-07T17:53:39Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)
#### Post date: [December 9, 2018, 2:23pm UTC](https://discourse.cataclysmdda.org/t/guide-to-adding-new-content-to-cdda-for-first-time-modders/17781/22 "2018-12-09T14:23:50Z")

</div>

## Adding new vehicles

New vehicles can also be added in JSON. This is relatively straightforward, but nevertheless tricky to get correct.

Vehicles are stored in the files in data/json/vehicles/ . The JSON is mostly documented at [https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/VEHICLES\_JSON.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/VEHICLES_JSON.md) so this is just highlights.

The JSON looks like this:

```auto
  {
    "id": "quad_bike",
    "type": "vehicle",
    "name": "Quad Bike",
    "blueprint": [
      ["O O"],
      ["=#>"],
      ["O O"]
    ],
    "parts": [
      { "x": 0, "y": 0, "parts": ["frame_vertical_2", "saddle", "controls", "controls_electronic", "horn_car"] },
      { "x": 1, "y": 0, "parts": ["frame_cover","engine_vtwin", "alternator_motorbike", "battery_motorbike", "headlight", { "part": "tank_small", "fuel": "gasoline" }, "plating_steel"] },
      { "x": -1, "y": 0, "parts": ["frame_horizontal", "muffler", "trunk"] },
      { "x": 1, "y": 1, "parts": ["frame_horizontal", "wheel_motorbike_steerable"] },
      { "x": 1, "y": -1, "parts": ["frame_horizontal", "wheel_motorbike_steerable"] },
      { "x": -1, "y": -1, "parts": ["frame_horizontal", "wheel_motorbike"] },
      { "x": -1, "y": 1, "parts": ["frame_horizontal", "wheel_motorbike"] }
    ],
    "items": [{ "x": -1, "y": 0, "chance": 10, "items": [ "helmet_motor"] } ]
  }

```

The important bit is the `"parts"` list. Each object in the parts list consists of an X, Y co-ordinate pair and a list of vehicle\_parts in the `"parts"` value. The X value increases to the right, the Y value increases to the bottom, and vehicle is assuming to be facing due east. Yes, I know the vehicle interaction menu has the vehicle facing due north, it’s completely confusing.

Each object in the main “parts” list is installed before the next object, and each vehicle\_part in each object’s “parts” list is installed in left to right order. The game’s engine actually builds the vehicle, one part at a time, and will fail to load if you attempt an illegal installation. So you have to be sure that all your parts lists start with a frame, and that each frame after the first frame has a frame adjacent to it. Engines have to be installed before alternators, seats before seat belts, turret mounts before turret weapons, and so on.

There’s also an `"items"` list at the very end, which is a collection of item\_groups that controls what items might randomly spawn with the vehicle.

### Spawning Vehicles

New vehicles need to be added to a vehicle group in order to spawn in the game. The vehicle groups are stored in data/json/road\_vehicles.json, data/json/vehicle\_groups.json, and in the various location’s mapgen files in data/json/mapgen/ .

road\_vehicles.json is really complicated, but vehicle\_groups.json is just lists of vehicles and the weighted spawn chance.

---

_[View the full topic](https://discourse.cataclysmdda.org/t/guide-to-adding-new-content-to-cdda-for-first-time-modders/17781)._
