Modding Help: Where Is This Located?

Hello, I’ve spent the last two days opening every Json file and much to my dismay I cannot seem to find a few things, so if someone wouldn’t mind pointing me in the right direction or explaining how it works to me I’d greatly appreciate it.

1): The Monster Flag groups such as “SEES” “HEARS” etc, I’ve got a few custom monsters I’m making and want to see how the code actually looks from a technical side for those things.
2): The mutation flags that don’t seem to exist?? Like Pain Resistance and how the game tracks it/how it works etc, because where most things will add a modifier I can’t crack the pain resist code.

Thanks in advance for helping a newbie.

The code part of the game lives in /src (either download the source code from github or clone the git repo), you want an editor capable of searching in files/folders like Notepad++.

1 Like

They are assigned internal MF_[FLAG] values in monstergenerator.cpp which are then used to check for flags in different cases (for example character.has_flag( MF_FLAMMABLE ) or like it’s used in monster.cpp).
The description/definition can be found in mtype.h.

Pain Resistance exists as a mutation with the ID PAINRESIST.
As for how the game checks it: It checks if the character has the trait/mutation as soon as a situation arises that would cause pain, right before applying it.

checking the doc files folder also helps if you need a refresher on how things work. And because the game is a conglomerate of contributions from different people, sometimes things can be “hiding” in the same file instead of the usual format of being seperate files, since some people don’t follow the same format. For example I’ve found sometimes when trying to track down the location of overmap files they can sometimes be hiding inside the mapgen files, instead of a separate folder.
What this means in your case in that instead of looking in different folders or files, the stuff you’re looking for might have already been defined in the same file as the thing its grabbing from. E.G. pain resistance might be in one entire folder, instead of spread out all across the json files