How do you create mods?

how do i make my own recipes and/or items for the game?

Look in data/raw/recipes.json and data/raw/items/{category}.json

For recipes there is the recipes.json. I will start with that since it is easier. Lets assume that you are making a recipe for something that is already in the game but is not craft able (it is easier, something like military rucksack). An example in the recipes.json is

        {
            "result": "backpack",
            "category": "CC_ARMOR",
            "skill_pri": "tailor",
            "difficulty": 3,
            "time": 50000,
            "reversible": false,
            "autolearn": true,
            "tools": [
                         [
                             ["needle_bone", 20],
                             ["sewing_kit", 20]
                         ]
                     ],
            "components": [
                              [
                                  ["rag", 20],
                                  ["fur", 16],
                                  ["leather", 12]
                              ]
                          ]
        },

Might be a bit hard to read because of the formatting but bear with me.
So for the most part it is fairly simple, so I will put my comments after the // on ever other line or so.

        {
            "result": "backpack",
// This is the name of the item, found in data/raw/items/{category}.json. More on that later.
            "category": "CC_ARMOR",
// This is the tab that the recipe falls in. More later.
            "skill_pri": "tailor",
// This is the first skill that is used, such as cooking, mechanics, survival, etc.
            "skill_sec": "survival",
// This is the secondary skill for the recipe, if there is none than delete that line.
            "difficulty": 5,
// This is the difficulty level that the recipe requires to make it, like a minimum skill level to craft. Just type a digit, no ""
            "time": 20000,
// This is the time required to make the object, in ticks. There are 1000 ticks in a game minute, plan accordingly. Again, just digit. This is 20 minutes game time.
            "reversible": true,
// A true/false option, decides if you can deconstruct it with the disassemble menu. Don't type any "" for this one. 
            "autolearn": true,
// A true/false option, decides if you can learn it automatically or just through a book. Here it is automatically learnt. No ""
            "tools": [
// This opens up the brackets for all tools necessary.
                         [
// This opens up the bracket for possible tools that do the same thing (rock hammer or regular hammer).
                             ["needle_bone", 20],
                             ["sewing_kit", 20]
// First come the crafting tool needed. Then the number of charges, if no charges (like hammer) type -1. 
                         ]
// This closes the bracket for tool variants, if there is another variation place it before this bracket.
                     ] ,
// This closes the bracket for all tools needed, if you need another tool place it before this bracket. 
            "components": [
// This opens up the things that will be consumed when the recipe is crafted.
                              [
// This opens up the possible alternative materials usable, such as different fabrics, or different stick-likes or others. 
                                  ["rag", 20],
// Same as before, it is the name of the object followed by the number needed to craft. 
                                  ["fur", 16],
// To craft this backpack it will take either 20 rags or 16 fur or 12 leather. 
                                  ["leather", 12]
                              ]
// This bracket closes the alternative materials usable for the first ingredient. 
                          ]
// This bracket closes all of the materials, so if you have any more add them before this bracket. 
        },
// This squiggly bracket closes off the recipe, so anything added outside of this is irrelevant to the recipe that you made. 

This is the basics on recipe crafting. I will update this thread with another post on how to work around in the data/raw/items/{category}.json files tomorrow, because where I live it is late at night.

But I suggest taking a peek at the items json files, just by looking at them your brain will absorb some information (hopefully).
If you have any questions about this post just ask them, I am sure that the forums are filled with very nice people…[size=1pt]except[/size].[size=1pt]for[/size].[size=1pt]some[/size]…

Great explanation, appreciate it.

One thing to be extra-aware of is commas

In the file it’s like:

{
   {
      <some recipe>
   },
   {
      <some other recipe>
   },
   {
      <the last recipe>
   }
}

Notice that all of the recipes end with “},” except the last one! All of the lists are like this, it can be really easy (especially if you’re copy/pasting a lot) to misplace a comma.

It’s the same within a recipe, if you have a list of tools for example:

"tools": [
            [
               ["screwdriver", -1],
               ["cheeseburger", 7],
               ["happiness", 9]
            ],
            [
               ["bionic_fingernail", -1]
            ]
         ],

There’s no comma after the “happiness” entry because it’s the last member of a list, and none after the “bionic_fingernail” entry for the same reason, the only entry in a list is the last entry.
To be clear, this means you have to have a bionic fingernail (but doesn’t use charges from it), and either a screwdriver (no charges used), 7 charges of cheeseburger, or 9 charges of happiness.

i think i see it. i gunna go try to make my own recipe for an item. thanks for the help.

I’m a novice too. Thanks for creating this topic, it helps me a lot and I’m sure many other future modders too.

Try this

http://smf.cataclysmdda.com/index.php?topic=2666.0
CataModder - Tool for editing Cataclysm files
By BMacZero

[quote=“stone94, post:7, topic:2234”]Try this

http://smf.cataclysmdda.com/index.php?topic=2666.0
CataModder - Tool for editing Cataclysm files
By BMacZero[/quote]
Is this one similar or better to JSONedit?

I’m currently using this one.