Expanded support for JSON modding

We really need this. I’ve been working on modding the game some, and digging around in the source is pretty difficult. I see no reason why disease and loot tables and artifacts and etcetera can’t be stored like the other items and such in JSON files in the Data/Raw folder. Why is it set up in such a restrictive way? It’d be a lot easier to mod in things that actually spawned and create new diseases, and it would open a lot of avenues in modding.

Why is it that it’s set up the current way, is essentially what I’m asking?

Also, why isn’t addiction stored in JSON files? All the corresponding drugs are, and I’d really like to create a few more new addictions that aren’t just a variation of cocaine, meth, nicotine, or heroin addiction.

We’re working on it.

Also, monsters and such ought to be stored in JSON. And why is it that rarity doesn’t do anything in regards to items? I’ve upped and lowered the rarity and the damned thing still doesn’t spawn like it ought to.

The reason is because we started with a system with 0 externally-moddable files, and we’re slowly converting data over as we have time.

The end goal is as you say, to have every piece of data pushed out to JSON files so they can be easily modded.

In addition to the sheer amount of time involved, we’re also trying to be careful to not code ourselves into a corner. The data migrations are a pain to do and very error-prone, so we’re trying to be very careful with them. Also we have some technical issues related to function pointers we’d really like a nicer solution to.

The next targets are probably vehicle parts and some of the misc items that haven’t been converted yet, and item spawn lists.

As Kevin mentioned, basically your wants and our goals are the same, it’s just that Whales had zero outside modding capability when Cataclysm DDA branched off, and also had a large fondness for hardcoded enums (which are a severe limitation in utilizing outside json files). We’re slowly working on converting that over to a more moddable format, but it’s going to take time and effort to convert it over.

When it was first created cataclysm was a game for game developers, they could mod it easily because they had the software to do it.

I think darkling ported it to windows so that I actually picked it up and stayed. So send him your angry emails praise.

But it was hard-coded to be neigh unmoddable by non-coders.

That’s pretty restrictive. This game has a good fanbase. People who want to contribute. I for one would like to contribute, but the learning curve for essentially learning a computing programming language is too steep. One of my top wishes for this game would be expanded JSON file modding support. Monsters, addictions, diseases, hallucinations, status effects, CBMs, all of these are unalterable unless you speak beep beep droid computer language. I for one do not speak beep beep droid.

Please… PLEASE… expand the amount of things dictated by JSON files. It makes it so much more accessible.

[quote=“TheGrifter, post:8, topic:1731”]That’s pretty restrictive. This game has a good fanbase. People who want to contribute. I for one would like to contribute, but the learning curve for essentially learning a computing programming language is too steep. One of my top wishes for this game would be expanded JSON file modding support. Monsters, addictions, diseases, hallucinations, status effects, CBMs, all of these are unalterable unless you speak beep beep droid computer language. I for one do not speak beep beep droid.

Please… PLEASE… expand the amount of things dictated by JSON files. It makes it so much more accessible.[/quote]

It’s not really meant to be restrictive, it’s just how the game was made by Whales. There’s also the fact that there are limits to how much stuff can be put into JSON files; especially regarding behaviours.

We are working on putting as much as possible out into JSON files, but some things, like CBMs, are likely not ever going to be fully editable in JSON files; the same goes for diseases and status effects.

I understand there are limitations. But why is it that addiction can’t be a JSON file? It’d make creating exotic drug addictions a lot easier. All we have now is XANAX addiction, Opiate addiction, amphetamine addiction, and cocaine addiction. I want to add Hyperzine, or some addiction to that crappy K2 synthetic crap. You know that variable, “addiction type”? If I just type in the name of the drug I’ve created, will it list that addiction in the status screen? Or just do nothing?

Thanks for beng so helpful, Williham. I really do appreciate this.

Addictions all function differently, thus they require hard coding in order to govern how they interact with the player and what exactly happens when a craving triggers. That limits any potential of putting them into the Json files. It could be possible to have a “generic” addiction type that could be used for any non-coded addiction just with a name change, but that would be about it.

As is if you typed in your particular thing into the addiction type field, it would pull up an unrecognized token error and it wouldn’t do anything.

As long map spawns get their own .json, I’ll be fine with that ;D

All I’ve wanted to do so far is add in new weapons, mods, ect. without having to do the whole installing new software to mod route. (Not that there is anything wrong with that system so far, things have their limits. I’m personally just too lazy to get it all set up haha)

I am also too lazy to do such a thing. There lies the problem. With JSON files, it’s just so easy.

I’ve wondered about the whole externality of things. Galactic Civilizations and Red Alert 2 have probably the best modding potentials I’ve ever seen. What was nice with both is even when the files lacked information, the game had all the defaults of pretty much nothing loaded. It would also make it easier to have save consistency across versions, as although new stuff might go in, unless you are reworking the old stuffs amount of values needed, you can just take on more things to be read into the array of character numbers (i.e. if say flammability was a character trait, it could go as trait like 26, where previously there were 25. new character saves have the value added at the end, where it won’t break things).

The spawn lists are now defined in data/raw/item_groups.json, though if you need new spawn locations, that still needs support in the game. Also the rarity of items is based on their spawn list rather than the item itself, so e.g. “cop guns” could be more common in police stations and “military guns” more common in FEMA camps.

Also there’s a sizeable change coming up soon in that ammo types are defined in the json files now instead of in the game proper, so you can add an ammo with a new type, a gun that uses that ammo type, and add both to the spawn lists, and you’re set.

e.g. the Sweedish Mauser
In ammo.json: { "type" : "AMMO", "id" : "6.5x55mm", "rarity" : 1, "price" : 650, "name" : "6.5x55 Swedish", "symbol" : "=", "color" : "dark_gray", "description" : "A rifle round developed in 1891 for use in the United Kingdoms of Sweden and Norway.", "material" : "steel", "volume" : 2, "weight" : 4, "bashing" : 1, "cutting" : 0, "to_hit" : 0, "ammo_type" : "65x55", "damage" : 30, "pierce" : 6, "range" : 32, "dispersion" : 12, "recoil" : 22, "count" : 20, "effects" : ["COOKOFF"] },

In ranged.json: { "id": "swedish_mauser", "type": "GUN", "symbol": "(", "color": "brown", "name": "Swedish Mauser", "description": "A bolt-action battle rifle designed for trench warfare for the Swedish armed forces.", "rarity": 1, "price": 1200, "material": ["iron", "wood"], "skill": "rifle", "ammo": "65x55", "weight": 35, "volume": 15, "bashing": 12, "cutting": 0, "to_hit": 3, "ranged_damage": 2, "range": 0, "dispersion": 5, "recoil": -4, "durability": 8, "burst": 0, "clip_size": 5, "reload": 500 },

And in item_group.json, insert “[“6.5x55mm”, 1],” in locations you want the ammo to spawn, and “[“swedish_mauser”, 1]” in locations where you want the rifle to spawn.

You can also make a crafting recipe for the ammo to allow assembly and disassembly of it, which requires a matching casing.

Still to come is a way to tell the game what casings to eject when you fire a given ammo.

Very nice.

Aye.

So, can we get Addictions, itemuse, and other stuff into JSON files? Honestly, I’d prefer that over crummy tile support. Once I get a good modding into it, tiles won’t be usable anyway for me.

I hate to be a nagger, but it seems like JSON support has fallen to the way side. I think the tiles are cool and every thing, but I still play on ASCII, and I’d really like it if monsters, addictions, and use functions got pushed to JSON. I hate to necromance a thread, but the point still stands.

I just opened this thread after switching to firefox from visual studio, immediately after working on moving some hard-coded data out to a .json file. What I’m saying is it’s being worked on.

As far as I know there are plans in the near future to start moving monsters out to .json files. As for use functions… unless you want to help work on lua support, that’s not happening. We just can’t express something like the use functions through static data files like json, you’d need an external scripting language with access to a large portion of in-game functions (i.e. lua) for that.