How do I mod the game?


#1

–Hmm. Well apparently I was told not to use one thread for several small questions. I guess I won’t do that then. Seemed like a good idea to me, but I’m just some random dude on the internet, and Kevin said not to. (Plus he closed the thread anyway)
–Here is a link to the thread that has broken links, in the event it becomes useful: Newby Guide to Compiling (and Editing) With Code::Blocks


#2

So do you have a question or did you just make this thread to rant and link to another?
It’s fine if you did, I totally get it, but it will probably get deleted then.

Looking at your other thread, I’d say your best bet is to just look at some of the mods in the game and work it out based on that, which is the way I learnt. It’s really not that difficult, but it will take an afternoon or so. You get a pretty good understanding that way though.


#3

What were you trying to mod?


#4

–I will attempt to search and expirement through that method, I guess. Although I tend to suck at research. And no, this is a legitimate question, I’m not just ranting.
–In terms of what I’m trying to mod, well, just generic different parts of the game. My idea was to create a simple mod that adds random tidbits here and there, first off (mostly for practice), then have a more focused mod when I understand things better.


#5

a large part of research is the curiosity and need-to-know to seek out answers for yourself, rather than relying on what others tell you, as they may be wrong, the person that told them may be wrong etc… thats how humanity advances. Granted our lives are also only so long, so a lot of the times we have to streamline things and take stuff for granted, knowledge included.

Good luck, let me know what you find works ^.^


#6

It’s also worth noting that there’s a good reason why people go to university before becoming researchers, since there’s no point reinventing the wheel and, well, you might fuck it up.

My point being, if you have issues ask questions, or if you need some guidance. There’s no point in suffering in silence when there’s so many people around who can easily help you. You do need to have your own direction to go though.

If I remember correctly, the first thing I made was the bow sights in my mod. I just copied the modinfo file from some other mod and rewrote it to my liking, then copied the attachments.json folder and deleted all but one entry and started rewriting things till it did what I wanted. Then ran it, fixed a spelling mistake, ran it again, moved a bracket, ran it again, changed the ID… There’s a lot of stuff that will screw you over, but the error reports from C:DDA are some of the most useful I’ve ever seen.


#7

Very first baby step with modding is to just go edit your json.
Pick an item or monster that you want to work differently (even if you don’t have something specific in mind, do something at random), find it in the data/json/ directories, make a backup of the file, then edit it. Then reload your game and either find or debug in the thing you modified, and interact with it.
This could increase or decrease HP of a monster, change their strength, add nutrition to an item, change its weight, change damage of a weapon, change some descriptions, etc.

The important thing is to make a change and then see it working in the game.

To expand on this, a big part of a science curriculum is walking you through the fundamental research so that you understand why the science community believes certain things. This instills confidence in those results so that scientists can build on it, but it also sets them up to question the results productively if they do have concerns.


#8

I enjoy the original Survivor loot drops from the survivor zoms. First things I add back every time I test a new experimental version of the game. It is the one real grip I have about the game that does not change as this was intended when it was changed.

Why? I don’t care. It makes sense to have a rare drop from a zom once in a while.


#9

Yeah, that’s basically what I meant. The first science class I have for my degree was a choice between “Understanding Science” and “Understanding Statistics”.


#10

–How would I properly make a backup in this situation? I’m not 100% certain as to how I would do that correctly. Although, I think I have figured out where the object of my desire that I want to change is (To Serve Man will be lethal against them too!).
–Took a little peek inside, and simply didn’t edit anything. I assume that wouldn’t create a problem, since nothing actually changed. Right? However, it’s ‘kinda’ hard to read. Is there some sort of way to better organize all that stuff on the screen?
–I found lots of different things in the files, but not for the life of me could I find any json for melee weapons! I found guns, tools, vehicles, and more, but not melee weapons! EDIT: NVM, I found it. It simply wasn’t where I thought it would be. Dang this is confusing :confused:
–Is there any sort of ‘search’ type thing you can use in the json files? That would be very useful!
–BTW, the title change for this thread is rather fitting (and just better). Thanks for that!


#11

If you’re just editing a Json you should be able to just copy that file to your desktop for safe keeping. I personally (since it’s a small ASCII game) would just copy my entire directory while I played with files. Just in case.


#12

–Hmm, I’m confused as to how I would alter damage and such on a book. Or is that not possible? I don’t see stats like that labelled anywhere. In melee.json it mentions damage stuff, but in cooking.json (Where To Serve Man is) there is a distinct lack of such.


#13

What with it being a book and all, it probably just has automatically generated melee stats based on it’s weight, volume, and material. If you added fields for melee damage they should apply, and you can just copy them from the melee weapons.


#14

–Okay, I will experiment with that. Otherwise, I would have just been like: “uuhhhhh.” Tally ho!
–Hmm, would order matter?
–How do you get pierce/stabbing damage? I only see cutting and bash in the json.
–Muhahahaha! To Serve Man literally exploded a zombie into tiny gory bits! Yay for 666 damage! And a zombie brute too!


#15

–Can someone help with NPC altering? I really don’t get it. And is there a way to alter/add new dialog options right from the get-go? For example, add another option to talking when you meet an NPC who is instantly hostile.
–Next question: How would you make this into a ‘mod,’ rather than directly altering the base game? From how it is currently, it seems as if you would have to download the entire game again just to get the mod to work.
–I’d like to put some random stuff together I’ve done and post it as a mod. It will mostly involve odd random stuff you can find, such as the Legendary Bacon Undies! Or perhaps the Book of Ultimate Bashing. And of course you can’t forget the Axe of Immense Weight and the Stick of Heroism. If you want an odd ‘helmet’
you can get the Afro of Encumbrance. I don’t know how to add them as drops and such so far, you can only debug them in.

-Okay, new problem I can’t figure out. I’m trying to officially make the Stick of Heroism, and include a recipe for it. I’m hoping one of you can help me figure out what’s wrong.
Code in recipe.weapon.json (for recipe):

{ “type”: “recipe”, “result”: “stick_of_heroism”, “category”: “CC_WEAPON”, “subcategory”: “CSC_WEAPON_BASHING”, “skill_used”: “fabrication”, “time”: 10000, “reversible”: false, “autolearn”: true, “components”: [ [ [ “stick”, 1 ] ] ] },

Code in melee.json (the actual weapon):
{ “type”:“GENERIC”, “id”:“stick_of_heroism”, “name”: “Stick of Heroism”, “description”: “This is a stick that can only be used in the end of times, when heros are truly needed!”, “weight”: 2000, “color”: “brown”, “symbol”: “/”, “material”: [“wood”], “techniques”: [“BRUTAL”], “flags”: “NONCONDUCTIVE”, “volume”: 10, “bashing”: 50, “price”: 1, “to-hit”: 10, },

-I looked at the id for the item heavy stick, which is simply, ‘stick’ and the Stick of Heroism was meant to be made of one heavy stick. So that’s why it’s like that.
-The DUBUG thing mentions something like load_character_tab BTW. I’m not certain how to include that and such. Even though I looked at some craftable weapons, I couldn’t manage to get it.


#16

–I’ve been messing around with the code a bit, so here is some of things that happened:

-I took the book ‘To Serve Man’ and gave it 1K damage. It promptly insta-splatted a zombie hulk with nothing but gory remains. :smiling_imp:
-I made the Afro of Encumbrance, which was meant to be stylish (I’m not 100% certain about that) and made it so wearing anything else was impossible/hard due to how big the afro was. However, the thickness of it gave it great bashing protection! Not much else tho.
-The Legendary Bacon Undies had endless pockets (Not really, but you’d need crazy strength to fill up all the volume), and an oddly large amount of fire protection. Not much else, but it covers your legs all the way!
-The Immortal Loincloth. It covers practically nothing (5% coverage), but bash, cut, fire, acid, and environmental protection were all set to 1K. Ya, if a zombie hulk wanted to do dirty tactics (and possibly pervert-like) by kicking you in the groin, you wouldn’t feel a thing!
-I also intend to make what’s called the ‘Annoying Zombie.’ He cannot damage anything, however he is stupidly fast, and has crazy amounts of damage that he can absorb. He is more or less just a really pesky distraction that can’t actually do anything other than annoy you.
-I’ll also attempt to make a Shotgun-Axe, which totally isn’t a reference to a show or anything. Nope. Totally not. Basically, you duct tape an axe to a shotgun. Pretty simple. It’s meant to effectively be a gun that is actually pretty decent in melee range, although is still rather slow. Not too much, but it’s still pesky.

-You may get it by now that I’m attempting to make a mod with ridiculous, stupid stuff in it. I intend to have all (or most) of the stuff I add have one or two really good effects, but not be particularly good at anything else. And possibly just not make much sense and it is just plain odd.

-I’m sure people will have many odd moments if they ever use this mod!
(Although I’m not certain as to how to make it officially and ‘mod,’ rather than just editing the game itself.)


How to mod the game?
Cataclysm Moments: The best, the worst, the funniest!
#17

I recommend you name it “Noober”.

That’s the next step, take a look at the folders in data/mods, that’s where the mods live.

  • Make a new folder in there with your mods name.
  • Copy the modinfo.json file from one of the other folders into it.
  • Edit the modinfo.json file to change the mod name, change the author name, change the description, etc.
  • Make a few .json files in there arranged however you want, i.e. “monsters.json”, “items.json”.
  • Copy your json edits into those files.

For your new entries that will Just Work :tm:, I can’t remember if having a copy of e.g. “To Serve Man” with changed stats will automatically overwrite the one in the main game, try it and find out.


#18

You can put in a line for overriding, but I’ve seen mods without it so I dunno what happens if you don’t have it.


#19

–Altering “To Serve Man” was just for practice reasons (And for my amusement). I instead have the Book of Ultimate Bashing which is used for the same purpose of how I changed To Serve Man. Deal crap tons of bash damage with a book! Although it isn’t quite so OP.
–How do you add a line for overriding? I don’t think I will actually do much overriding of things already in game, that was (like for To Serve Man) for practice and such.
–I’m having quite a bit of trouble trying to get recipes for anything I make to work. If you didn’t notice, a comment above mentioned me trying to make a crafting recipe for the Stick of Heroism, which I couldn’t quite get to work (Although I did squash a couple bugs early, such as writing volume twice). I’ve gone over recipes and such in the files, but I just can’t quite figure it out.
–The weapon itself seems to work fine, but adding a recipe for it I just can’t quite figure out.

–Okay, new problem: DEBUG says this “member not found: type” Then “FUNCTION: bool main_menu::new_character_tab()”
–There isn’t any quotation marks in it of course. I’m not certain what this is talking about. I don’t recall this happening before, but I added my stuff to its own mod folder and changed a couple small things that shouldn’t matter in terms of errors then started a new world. Then this happened.

–I also realised that earlier I phrased things in the wrong way. What I meant is that I was going to make the Shotgun-Axe, the Annoying Zombie, and the Immortal Loincloth.


#20

It would be more useful to paste the debug log in code tags, im not sure how to do it in discourse though but pastebin is good too. If you want you can pm me your recipes and stuff and ill try and help you figure it out.