–This thread is meant to give a (hopefully) good reference to those who wish the mod C:DDA. I’m still learn a lot myself, so don’t expect it to be perfect, but I’ve learned quite a lot of things so far. There is a lot to say, so dropdown menus are very much needed.
–Hopefully you can easily navigate the dropdown menus to better find out how to make weapons, armor, food and more! And I’ll update this part of the thread as I learn more of how the game works.
BASICS and BEGINNING
You can choose to make a backup of the entire game itself, but that’s only necessary if you alter the .json of the game itself. In this tutorial we won’t actually be altering the base code at any point, just what is in your mod folder.
Making your mod folder!
You probably want your mod to be in it’s own folder, right? Go to the game directory > data > mods. Copy the modinfo.json from any of the existing mod folders and add it inside your own. Name the folder whatever your mod is going to be called (I’m not certain but an _ might be needed if you have a space). Inside modinfo.json (the one in your own mod folder) you’ll find something along the lines of
THIS
[
{
“type”: “MOD_INFO”,
“ident”: “Red’s Odd Additions”,
“name”: “Red’s Odd Additions”,
“authors”: [ “redxlaser15” ],
“description”: “Adds some rather odd items, creatures, and such to the game.”,
“category”: “misc”,
“dependencies”: [ “dda” ],
“obsolete”: false
}
]
WARNING: DO NOT CHANGE THE “type”: “MOD_INFO”! KEEP QUOTATION MARKS AND SUCH!
Remember when editing this stuff remember to only edit the stuff inside the second quotation marks. For example “description”: “WHAT YOU EDIT”
Ident is used to identify mods in the modlist for a save file. Try to make it simple, or possibly just the name of you mod. Change author to your name (Or I guess whatever you want). Put inside description a description of your mod. I can’ manage to get categories to work, but it won’t create too big of a problem. Make sure obsolete is false, and that you have “dda” as a dependency.
Now you have your own mod folder!
It is highly recommended to make seperate .json folders inside your mod folder for different categories. For example: melee.json could be for melee weapons ranged.json could be for ranged weapons.
Each .json always needs to start with [ and ] at the end. You’ll put your different items, armor, and various other things inside { }. Each time you make a seperate item (or something similar) you need to add a different { }. Ensure you add a , behind the previous } for the game to properly recognize that this is a different thing!
Remember to select your mod whenever you begin a new world! And as you go only, don’t be surprised if plenty of DEBUG errors come along, it’s all part of the learning process!
It is quite possible that at some point you might new a new world to avoid incompatibilities with your mod and what currently exist in the game. Example: You can an item in the world and you change the .json ID to something else. That means the current item will be bugged and useless. That isn’t strictly game-breaking, but it’ll be weird.
For the game to recognize new changes to the code you need to exit the world you are currently in and then go right back in. You don’t need to exit all the way out of the game!
Always remember to TEST OUT YOUR CODE after each little bit you alter in the .json and try your best to avoid typos! If you have an error when entering the world the DEBUG thing will pop up, it’s usually pretty useful and can really help to point out little typos and such.
Remember, just because you are learning from this DOES NOT mean you shouldn’t use the .json from the game itself to use as a reference too! Some things can be a bit hard to find, but it is in there somewhere!
It is a good idea to use the DEBUG menu (I think it you need to set the keybind in settings) ingame to help you test out items and such in the game.
Most likely you’ll typically look at .json that you can locate in the files at Directory > data > json to reference ingame code and (to access your mod like before) Directory > data > mods ‘your mod’
I think that’s it for the overall basics of this whole thing. If I miss something I’ll add it ASAP
Personally, I feel like making a new item is the best first step you can ever make. It’s (in my opinion) the easiest thing you can do when you are starting off. So here we go!
MAKING ITEMS
I’ll use the reference I first used when making an item. We’ll simplify it down so it’s no weaponised for now, however. Directory > data > json > items> melee.json
You’ll see at the very top inside the .json the item Mjolnir. I recommend copying all the info from mjolnir to a .json in your mod folder rather than doing it from scratch. It’s easier and reduces typos. Remember, the info for Mjolnir goes from the original { to the }, at the end. DO NOT INCLUDE THE COMMA! That will break it if you have no other item under it.
For now, let’s not mess around with the item type. Keep it as GENERIC.
The id is super important. That’s what the files use to recognize the item and help you use the item again for things like crafting and such. Don’t put spaces within the id, I believe that will mess it up. Instead use _ for spaces. Always try to keep it simple and memorable; The id of Mjolnir is literally mjolnir. I’m not certain, but I think you need to have the id all lower cases. I’ve always made the lower cases since I’ve never seen any ids uppercase. You can try it yourself if you want to.
The name is simple, just name your item what you want. Unlike the id, this can include caps and spaces (this is obvious if you are actually referencing mjolnir. But just in case).
Replace the stuff inside the description with whatever you want. I believe you can make it as long as you desire.
Weight is how heavy the item is. I have trouble properly balancing weight to my desire, and I highly recommend you try out different amounts for your item till you get roughly what you want. MAKING AND ITEM 0 WEIGHT BREAKS IT!
Color is the color of the item as it lays on the ground. Some color options you may want are not available (such as orange ). Try using a reference and/or experiment to see what works.
Symbol is, of course, the symbol of the item as it lays on the ground. DO NOT USE THIS SYMBOL: \ You can use the other version like this, / but otherwise it breaks. (I learned the hard way).
If a tileset is used on this item (which is unlikely for now unless you make your own), then neither color nor symbol is relevant.
Material is what the item is made out of. This defines its resistances and such to various things. Like bashing damage, cutting damage, fire damage, and so on. You can find all the different types of materials inside of materials.json (Directory > data > json). Later on I’ll teach you how to make your own materials! Remember that the id of the material you are looking at is what you put inside [ “Right here!” ] If you want something to be made out of multiple materials, add a comma after each quote inside the [ ] and use more quotations. (Mjolnir uses [ “wood”, “steel” ]
Techniques we won’t mess around with for now, but in short these are the melee abilities that can trigger when using the item in combat. For now, just delete it all. ( “techniques”: [“BRUTAL”, “WIDE”], )
Flags define various different attributes for different things. Remember that flags need to be in all caps. Mjolnir is NONCONDUCTIVE, which means that it does not conduct electricity. Let’s keep that for now. There are a lot of different kinds of flags. Some flags only work on certain things. (You can’t make a flag for a monster work for an item.) I don’t know the whole list of various flags, but I recommend searching around the .json for different ones to experiment which what does what. Let’s keep that flag for now.
Volume is how much space it takes up in your inventory. 1 volume is equal to 0.25 inventory space I believe. I’m not certain how to lower it further down than that (0.01 volume).
Bashing is damage related. Let’s get rid of that for now.
Price is how expensive and item is. For it to be one dollar you need the price to be set at 100. Setting the price of an item to 1 means it is worth one cent.
Qualities relates to what sort of abilities it has for use in crafting. Mjolnir has hammering 1 (similar to a basic rock). Whether you change that or not is up to you. I’ll bring this a bit more in depth later
Remember that there CANNOT be a comma right before the ending } otherwise it will break!
There you go! The basics of how to create an item. I encourage you to play around with various settings and such and use references from other objects in .json to learn what you can and can’t do!
MAKING MELEE WEAPONS
This is effectively a continuation of MAKING ITEMS but focuses around creating an actual (melee) weapon itself.
Now, let’s take another look at Mjolnir! ( data > json > melee.json ) You can either read along, alter the game’s direct code (unrecommended), continue to alter the item you made in MAKING ITEMS, or copy and past the stats for Mjolnir into your own mod folder.
You’ll see that it has bashing: 9999, which is a lot. The damage you put on the weapon in the json is directly and exactly what it is ingame. So if you get Mjolnir ingame it will deal 9999 bashing. Cutting damage works just the same. if you replace ‘bashing’ with ‘cutting’ on mjonir’s stats, it would instead deal 9999 cutting damage! Remember that you can easily do both at the same time!
You may be wondering: How do I deal piercing damage? It’s a bit different for that. You need to use the flag STAB, ( Like this: “flags”: [“STAB”] ) which replaces cutting damage with piercing. In the json you’ll still use the term ‘cutting,’ but ingame that will be replaced with piercing damage instead.
Techniques can be pretty important: it defines the ‘special abilities’ you can use with your weapon. Mjolnir has the techniques BRUTAL and WIDE. Ingame you can see better details of what each ability does. You can find them all in data > json > techniques.json. I’m still learning the details of how to change and make techniques are sadly, but this will at least show you the options!
Weight can be important when making weapons, as it defines how long it takes to swing said weapon; The heavier the weapon, the slower the weapon.
Whether the item is conductive or not can be pretty important for a weapon (and armor). If a weapon is conductive, you could get shocked when attacking with it. Be sure to use the flag “NONCONDUCTIVE” if you don’t want to get zapped!
There are other flags that are weapon specific, such as REACH_ATTACK or SHEATH_SWORD.