I've got an idea for a mod I would like to create, but I need to figure out if it's possible to code a prisoner search? I'm not sure where in the existing files I would need to look to find the code that is activated when you search a prisoner from the prisoner tab.

I'm relatively new to the PA code base, but until you get a more comprehensive answer: I'd suggest looking at the Policy code, and maybe try implementing the action you're trying to trigger a search for as a new item on the Policy list. That way you'll be able to trigger a range of actions on the targeted behavior.

EDIT: to be a little more helpful, check here: Prison Architect\data\dialogs\report-policy.txt

I think this close to our starting point. This is the right panel, but it's missing locations for the punishments. I'm still trying to work out how this gets populated.

From the base-language.txt file I was able to narrow down the terminology of what we're looking for

I'm still trying to locate where/how this behavior is defined/identified.

EDIT2:

The jury is still out, but I'm also interested in this, so I'll keep poking around. From what I've been able to gather the situation is like this: The API has access to the behavior, or some of it at least, but the behavior constructor does not appear to be part of the API (I'd really like a look inside the basketball court mod). So, in theory, if we knew the criteria and configuration of the behavior: we could write our own constructor by extending C++ through Lua, and this should be where we can get into identifying things like entering restricted areas as misconduct.

EDIT3:

Start a new prison in game, turn on the developer tools, and press f4; you'll get a dialogue editor. You can then save this dialogue as a file in AppData\Local\Introversion\Prison Architect\dialogs. I suspect this is how much of the sorcery with the Policy report was created; as these fields then can be referenced by name via script. This doesn't address adding a classification for misconduct yet, but it begins to address how to add an item to the Policy Report.