Modding Q&A thread

How hard would it be to push the functions in iuse.cpp into a JSON file?

I’ve already implemented iuse’s in lua. JSON is probably not going to happen, as it’s not a programming language.

[quote=“xibalba”]So will all the tables of things - traits, mutations, items, enemies, terrain, bionics, artifacts - eventually have all their resources located in a single location (a bunch of folders full of json files apparently)? Because I really want to do something with artifact generation, traits available at creation, mutation tables, and bionics - but I don’t want to chase down all this data myself.

I mean some things are located in the source files for game mechanics, but I’m not interested in editing game mechanics, except maybe to see more options available to tweak them a bit at character creation and during the game. I don’t want to edit the game mechanics, I just want to balance the game according to what I think makes a good game.

Besides it’s easier to share a bunch of json files than it is to recompile it when I want to play someone else’s changes.[/quote]


That’s the eventual plan, yes, though due to the way that some of it works it might be very difficult to convert some things out (such as bionic and mutation effects). Some of the sooner things that you might be able to expect are the enemies and terrain, both of which hopefully shouldn’t take too much work to convert over (though with terrain memory size might come into play to slow us down a little).

Will addiction also be farmed out to lua or json files for easy editing? Slurm, now with new hyper addiction.

Yea, it should be possible to export the addition types.

grep pattern *.cpp *.h

You could also just use code blocks, open up the project, and hit ctrl+f to do a full project search.

I want to create new types of buildings. More specifically I want to make campsites spawn near cabins. These campsites would be small clusters of tents, perhaps some corpses and a bear. Which files deal with buildings?

Buildings are in building_generation.cpp, building_generation.h, mapgen.cpp, and overmap.cpp depending on what you are doing. Yes you will need to compile after changing them.

Firstly, this thread should possibly be stickied :smiley: Had to dig a bit to find it :frowning:

So… I’ve got this added to monsters.json:

{ "type":"MONSTER", "id":"mon_human_terror", "name": "terrified human", "species":"MAMMAL", "symbol":"@", "color":"ltgray", "size":"MEDIUM", "material":"hflesh", "diff":4, "aggression":20, "morale":10, "speed":100, "melee_skill":4, "melee_dice":1, "melee_dice_sides":3, "melee_cut":0, "dodge":3, "armor_bash":0, "armor_cut":0, "item_chance":25, "luminance":0, "hp":40, "special_freq":0, "death_function":"NORMAL", "special_attack":"NONE", "description":"A nearly unrecognizable human being, obviously unfit to deal with the stress and danger posed by the cataclysm.", "flags":["SEES", "HEARS", "WARM", "BASHES", "HUMAN", "VIS40", "BONES"], "placate_triggers":["PLAYER_WEAK"], "fear_triggers":["PLAYER_CLOSE", "HURT", "FIRE", "SOUND", "FRIEND_ATTACKED"] },

And this tacked to the end of the HOUSE set in monstergroups.json:

{ "type":"monstergroup", "name" : "GROUP_HOUSE", "_comment" : "+15% child", "default" : "mon_zombie", "monsters" : [ { "monster" : "mon_zombie_child", "freq" : 150, "cost_multiplier" : 2 }, { "monster" : "mon_zombie_cop", "freq" : 20, "cost_multiplier" : 2 }, { "monster" : "mon_zombie_fast", "freq" : 70, "cost_multiplier" : 2 }, { "monster" : "mon_zombie_grabber", "freq" : 70, "cost_multiplier" : 1 }, { "monster" : "mon_skeleton", "freq" : 30, "cost_multiplier" : 2 }, { "monster" : "mon_zombie_smoker", "freq" : 30, "cost_multiplier" : 5 }, { "monster" : "mon_zombie_swimmer", "freq" : 20, "cost_multiplier" : 2 }, { "monster" : "mon_zombie_shrieker", "freq" : 30, "cost_multiplier" : 5 }, { "monster" : "mon_zombie_spitter", "freq" : 30, "cost_multiplier" : 5 }, { "monster" : "mon_zombie_electric", "freq" : 30, "cost_multiplier" : 5 }, { "monster" : "mon_zombie_necro", "freq" : 1, "cost_multiplier" : 25 }, { "monster" : "mon_boomer", "freq" : 30, "cost_multiplier" : 7 }, { "monster" : "mon_zombie_brute", "freq" : 10, "cost_multiplier" : 15 }, { "monster" : "mon_zombie_hulk", "freq" : 1, "cost_multiplier" : 50 }, { "monster" : "mon_zombie_master", "freq" : 1, "cost_multiplier" : 25 } { "monster" : "mon_human_terror", "freq" : 320, "cost_multiplier" : 2, "pack_size" : [1,10] } ] },

And its crashing my game flat on startup with no debug messages now (after I battled many missing commas)… The only thing I see that could potentially cause it is the inclusion of the pack size in monstergroups, or maybe changing the “flesh” tag over to “hflesh” in the monster code… Do I have some conflicting tags? WHATS WRONG?! :frowning: I have a feeling indention or a comma is stealing all my time away :>

EDIT!: harvested the code strings and updated my experimental, replaced the above code and it works (though I haven’t found my scared humans spawning naturally yet… Guess it was some conflict with some wild SCIENCE I was conducting with ranged weapons on the same build… Burst-fire plasma flamethrower, and then I changed the ammo type for blowgun to “gasoline” to see if it’d spit liquid gas that hadn’t been ignited… It doesn’t, just fiery 3x3 explosions :P) So I’m all good on this one…

comma between zombie master and human terror?