Is there code to trigger a search of a prisoner?

Discussion about Mods for Prison Architect

Moderator: NBJeff

azairvine
level1
level1
Posts: 39
Joined: Sun Jan 11, 2015 11:43 am

Is there code to trigger a search of a prisoner?

Postby azairvine » Sun Dec 04, 2016 11:38 am

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.

Any help would be appreciated!
S1eepy
level0
Posts: 6
Joined: Thu Jan 05, 2017 2:43 pm

Re: Is there code to trigger a search of a prisoner?

Postby S1eepy » Fri Jan 06, 2017 3:22 am

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

Code: Select all

misconduct_reporttype_complaint             Complaint
misconduct_reporttype_destruction           Destruction
misconduct_reporttype_escapeattempt         Escape Attempt
misconduct_reporttype_injuredprisoner       Attacked Prisoner
etc...


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.

If you copy

Code: Select all

Prison Architect\data\dialogs\report-policy.txt
into

Code: Select all

AppData\Local\Introversion\Prison Architect\dialogs\
, tab back to PA, and load report-policy.txt in the dialogue editor: you can see how it's put together.

Return to “Modding”

Who is online

Users browsing this forum: dsdude123 and 1 guest