# How do I mod the game?

**URL:** <https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672>\
**Category:** The Toolbox\
**Created:** [June 12, 2018, 5:06am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672 "2018-06-12T05:06:19Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 16, 2018, 8:25pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/101 "2018-07-16T20:25:42Z")

</div>

Nope, still makes a massive kerblam sound. The shadow staff is meant to effectively be a silent, massively piercing, sniper staff. This is most certainly _not_ silent. I’m kinda curious as to why I’m not deaf by now tho. Seriously, it just made over 100 sound.

---

<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:** [July 16, 2018, 8:31pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/102 "2018-07-16T20:31:14Z")

</div>

You can set loudness on ammo, too. You might try that. And if that doesn’t work out, I’m out of ideas.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 16, 2018, 8:32pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/103 "2018-07-16T20:32:35Z")

</div>

Yes! Thanks for that! I needed to do it on the ammo! I have no clue why I didn’t think to try that out too.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 16, 2018, 9:27pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/104 "2018-07-16T21:27:08Z")

</div>

–How do you add monster and item spawn locations? I looked into mapgen but I can’t figure out how I’d do it. Especially since I want to add it to a mod folder and add said monsters and items to already existing mapgen. It’s very confusing to me.  
–Also, how the heck do you actually build a place too? It’s so confusing and weird as to how it’s meant to be made. What’s with all the weird symbols and stuff all over?

---

<div class="post-metadata">

**Author:** ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)\
**Post date:** [July 16, 2018, 10:25pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/105 "2018-07-16T22:25:50Z")

</div>

Item spawns are done by adding item ids to itemgroups, just look at the itemgroup files added by some content mods. I think monster spawns are handled similarly. Buildings have to actually be represented in text, with each symbol correlating to a type of terrain tile. You’ll need a compatible text editor to read it properly though.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 16, 2018, 10:36pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/106 "2018-07-16T22:36:51Z")

</div>

–I don’t see any group stuff like that anywhere. Can you better elaborate as to how that all works?  
–What kind of text editor would I need? And is it just not possible to do it in json, or is it simply stupidly hard?

---

<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:** [July 17, 2018, 12:22am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/107 "2018-07-17T00:22:27Z")

</div>

You edit the json text with a text editor.

take a look at data/json/mapgen/fire\_station.json - I chose it because fire stations are fairly memorable within the game.

At the top, there’s a definition of the fireman\_doc item\_group, a collection of books that might be in the fire station.  
Immediately after that is the GROUP\_FIRE monstergroup, which mostly consists of sets of 3-5 fireman zombies, but sometimes has normal zombies in it.

Then there’s the actual firehouse terrain, followed by place\_items and place\_monsters blocks. place\_ syntax is a little opaque to me, but there’s an 80% chance of having items from the bed item\_group on each square of the beds, a 70% chance of items from the novels item\_group on the counter between the beds, etc. There’s also (I think) a 1% chance of a GROUP\_FIRE spawning on each tile between x2:y9 and x21:y21, so basically the vehicle bay.

Finally, there’s a 30% chance of a single fire engine spawning in the vehicle bay, aligned as though it had pulled into the bay.

Adding monsters to a monstergroup should be easy:  
use the copy-from to make a copy of the monstergroup, then extends the monsters field:

```
{
  "name": "GROUP_FIRE",
  "type": "monstergroup",
  "copy-from": "GROUP_FIRE",
  "extend": {
    "monsters": [
      { "monster": "mon_zombie_blazer", "freq": 10, "cost_multiplier": 5 }
    ]
  }
}

```

Similar syntax for an item\_group.

The weird symbols in the mapgen rows list are the symbols that make up the map, and are decoded in the terrain dictionary beneath it. For instance, the ‘M’ symbol represents the t\_door\_metal\_locked terrain, and you can see the metal door to the interior of the station and the two metal garage doors in the rows list.

---

<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:** [July 17, 2018, 12:23am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/108 "2018-07-17T00:23:57Z")

</div>

Okay, that’s how modding monstergroups SHOULD work, but apparently it won’t work exactly that way until this PR goes through:

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/24301>

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 17, 2018, 1:20pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/109 "2018-07-17T13:20:49Z")

</div>

–Okay, I _think_ I know about what you’re getting at with the fire\_station. Mostly, anyway. It’s rather confusing but I _think_ I can manage to do it, at least for the most part.  
–Although I’m still a bit confused about how to ‘extend’ item/monster groups. So you’re saying extending a monster group isn’t possible just yet? But item groups are?  
–Also, do you know of a good text editor that I can use? That is also free? Since I’m not paying for one.  
–What does ‘cost multiplayer’ do?

–I still have no clue what ‘density’ does in material traits BTW.

–I’m working on some bionics, but I can’t figure out how to actually add stats and stuff to them. As in things like extra dexterity or armor.  
–The baconite exoskeleton (the bionic I’m working on) doesn’t seem to show up as an item either.  
–Would making a recipe for the baconite exoskeleton be done just like items?

---

<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:** [July 17, 2018, 4:35pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/110 "2018-07-17T16:35:18Z")

</div>

I use vim on Linux. Which isn’t a good text editor in general, but I have historical reasons for liking it. kate or gedit are more modern editors that are decent.

On Windows, notepad++ is decent, free, text editor.

Apparently, you can extend a monster group, but currently, the syntax overwrites the monster list instead of adding new entries. glamcube17 has submitted a patch to fix that.

There’s no “cost multiplayer”, but “cost multiplier” indicates the additional cost that monster group has from the spawn pool. The spawn pool determines how many zombies show up at once based on your spawn rates: with normal settings, it might have 10 spawn points. If a single zombie is 1 spawn point, then my extension would guarantee if you see a blazer zombie, you won’t see more than 5 normal zombies at the fire station.

bionic effects look to be hardcoded in src/bionics. bionic recipes are with the rest of the elctronics in data/json/recipes/recipe\_electronics.json.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 17, 2018, 4:40pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/111 "2018-07-17T16:40:54Z")

</div>

Does that mean that I can’t make new bionics right now? That seems dumb and inefficient.

---

<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:** [July 17, 2018, 4:43pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/112 "2018-07-17T16:43:22Z")

</div>

You’re more than welcome to move the bionics out of the source code and into json. This is an open source project, you can make the changes you want.

The list of changes I want to make to the game is pretty long, but I’m working on them as I get a chance.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 17, 2018, 5:04pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/113 "2018-07-17T17:04:05Z")

</div>

I don’t know how to do that.

---

<div class="post-metadata">

**Author:** ![TheMurderUnicorn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/themurderunicorn/32/5706_2.png) [@TheMurderUnicorn](https://discourse.cataclysmdda.org/u/TheMurderUnicorn)\
**Post date:** [July 24, 2018, 12:50am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/114 "2018-07-24T00:50:02Z")

</div>

Man, I was interested in working on a mod but after looking in the files I’m just as confused as I’ve ever been. I don’t know much programming (and that’s C#) and thought editing the json would be straightforward even for a layman. (I wanted to create a college similar to the way a Mansion is laid out but I’m realizing that would be a large project for a noob).

Working with the fire-station stuff you were talking about . . . How do you know what items will spawn in those groups? IE: there’s a 70% chance of spawning “fireman\_gear” in certain spots. How do you know what objects fall in as fireman\_gear? I can’t find an item group with that id. It’s not in the gear itemgroup.

If I’m understanding things, the items jsons define each item in the game, which is where I’d plug in a newly created item. Itemgroups define what groups those items fit in, yes? So I would have to assign my new item to a particular group in order for it to spawn? And then each particular tile in a mapgen file defines which groups of items might spawn there, so if I created a new itemgroup I’d have to assign it a place to spawn?

---

<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:** [July 24, 2018, 2:16am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/115 "2018-07-24T02:16:13Z")

</div>

As usual, I highly recommend getting a command line installation of git and cloning the repository to your local machine if you’re thinking about doing development, because while github is an adequate project managemet tool, it isn’t anywhere near as good as git grep for searching the entire repository for specific strings.

the command  
`git grep -n fireman_group data/json`  
returns  
_data/json/item\_groups.json:7719: “id” : “fireman\_gear”_  
and looking through item\_groups.json on line 7719, there’s an item\_group filled with firefighter related items.  
Oh, btw, C:DDA JSON has this slightly weird organization where you have thing\_type.json and thingtype/subtype.json and it’s not always clear where an item should be. You have to look at both places (or just use git grep, which does the looking for you).

And yes, new items need to be added to item\_groups to spawn on the map, and new item\_groups needed to added to maps in appropriate locations.

Mansions are not a great starting point for your first mod, because they’re semi-randomly generated and really big. I would start with something much smaller, like the fire station or church. You want an education related building, so maybe the school\_1.json - it’s still a 3x3 set of tiles, but it’s a single map in the file and it’s pretty easy to understand.

---

<div class="post-metadata">

**Author:** ![TheMurderUnicorn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/themurderunicorn/32/5706_2.png) [@TheMurderUnicorn](https://discourse.cataclysmdda.org/u/TheMurderUnicorn)\
**Post date:** [July 24, 2018, 2:28am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/116 "2018-07-24T02:28:24Z")

</div>

I didn’t even know it was possible to search the entirety of the thing. I was just flipping through my cataclysm game directory and searching in notepad++. Being able to search will help a lot.

I don’t know, really, how to use anything command line related, but I’m sure the google does, so I’ll figure it out. Thanks for the help.

Yeah, I know it would be a big thing to do, I was just trying to think of something that isn’t in the game that I could maybe contribute to. I probably will start just by adding small variations of things that already exist.

---

<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:** [July 24, 2018, 4:04pm UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/117 "2018-07-24T16:04:35Z")

</div>

I’m a command line tools guy, but I’m told there’s a kraken program that lets you do most of the useful stuff of git through a gui. The important part isn’t how you access git, the important part is that git is a very sophisticated tool, written by programmers to manage a huge mass of source code, and you should take advantage of that tool.

Starting small is good, and variations of existing stuff are good, but you should only work on stuff that excites you. 75% of the PRs I’ve contributed recently have been “this is something that I would like in my game” and the rest are “this is something the game should have.” Hide bags, livestock stalls, and consolidated electronic controls are the first; vehicle descriptions are the second. But in both cases, they’re things I think are important and I’m not working on things I don’t think are important. In terms of getting stuff done, it’s probably better to try a bigger thing that you care about than a small thing that you don’t.

Anyway, go make some stuff and ask questions if you need help.

---

<div class="post-metadata">

**Author:** ![TheMurderUnicorn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/themurderunicorn/32/5706_2.png) [@TheMurderUnicorn](https://discourse.cataclysmdda.org/u/TheMurderUnicorn)\
**Post date:** [July 29, 2018, 1:47am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/119 "2018-07-29T01:47:23Z")

</div>

Okay, two questions.

1. Is it possible to create a monster attack just using json? I’ve looked at monster\_attacks.json and copied an entry, virtually identical, giving it a new name. When I try to assign the new attack to a monster I get an error on launch saying that it’s not a valid special attack. Any insight?

2. What determines how many items you get when salvaging something? IE: If I butcher a leather jacket I get x leather patches. What determines the maximum number of patches you can get? Also, if an object is made of multiple materials, how does the game decide what items you get when butchering/the ratio of the two materials? If that makes any sense.

---

<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:** [July 29, 2018, 2:14am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/120 "2018-07-29T02:14:51Z")

</div>

I copied all the json in data/json/monster\_attacks.json for “impale”, changed the id to “otherimpale”, and changed the feral predator’s second special attack to otherimpale. Worked fine. Could you share your json - push it up to a temporary branch on your github repo and share the link, please.

I don’t know how salvage works, sorry.

---

<div class="post-metadata">

**Author:** ![TheMurderUnicorn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/themurderunicorn/32/5706_2.png) [@TheMurderUnicorn](https://discourse.cataclysmdda.org/u/TheMurderUnicorn)\
**Post date:** [July 29, 2018, 2:22am UTC](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672/121 "2018-07-29T02:22:29Z")

</div>

It literally was just a copy paste with the name changed. I’m still new to organization and had slated ‘learn to use git-hub’ for next week, so I can’t show anything off yet.

Buuuuut, anyway, the problem, I think, was that I was trying to enter the attack in the same json as the entry for the monster? That or I failed the simplest act of copying and pasting. I set up a new json for monster attacks and it works now.

[Previous page](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672.md?page=5)

[Next page](https://discourse.cataclysmdda.org/t/how-do-i-mod-the-game/15672.md?page=7)
