How do I mod the game?

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.

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

1 Like

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.

–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?

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.

–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?

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.

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

–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?

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.

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

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.

I don’t know how to do that.

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?

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.

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.

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.

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.

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.

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.