Overview
If you’re new to modding, this guide will give you an overview of how to mod effectively. This mod covers everything except LUA scripting, and it also has a list of all the Properties you can apply to things. 🙂
What is a mod?
A mod is something that changes or adds to Prison Architect’s gameplay in some way. It could be as big as a complete overhaul or as small as an extra door.
Mods in Prison Architect come in self-contained folders, so you don’t have to manually change any important game files. 😀
NOTE – This guide is still under construction and is by no means exhaustive.
How do I make a mod?
Funny you should ask! To make a prison architect mod, there’s a few things we have to do first:
Before you even start, there are a few things you must do.
If you haven’t already, go to C:Program Fles (x86)SteamsteamappscommonPrison Architect on Windows or ~/Library/Application Support/steam/steamapps/common/Prison Architect.app (right click on it and click “Show Package Contents”)/Contents/Resources, and extract main.dat with some unarchiving program.
Get the resulting folder and name it “data”, this is what the game uses to find out what everything is and what it should do. If you get stuck, refer back to here for ideas on how the devs did it.
Now open Prison Architect, go to Options -> Open Save Folder, then look for a folder called “mods” inside. There should be a bunch of folders with a string of numbers in them, make a new folder inside it and name it whatever you want. This is going to be the folder where your mod lives. 🙂
In this folder, you are going to need 3 things – a text file named “manifest.txt”, a picture named “thumbnail.png”, and a folder named “data”. I will go into further details on these soon.
Remember, leave an empty line at the top and the bottom of each document. This helps the game recognise your custom stuff.
manifest.txt and thumbnail.png
This is where you are going to put some information about your mod.
Make sure you are typing in plain text, and ensure your word processor has “Smart Quotes” disabled, otherwise your cool mod called “Mod Name” is going to show up as ???Mod.
There are three things you need to put in this document: a name for your mod, the name of the author/s (you, probably), and a description.
For example:
Name “Mod Name”
Author “Pulse”
Description “Look at this cool mod!”
You can also add in a date and a version number in this way, but it’s optional.
This is going to be the picture that comes up when people gaze upon your mod in wonder in the Workshop. You want it to be square and of a reasonably high quality, so that it can be fawned upon properly.
data
Ok, this is the big one. Your data folder is where your mod is, and Prison Architect is going to look through here for all the data it needs to make your mod run.
What you do in here depends on what you want your mod to do, so I’m going to cover as much as I can. There are a few files in here that do different things, they are:
production.txt
research.txt
materials.txt
jobs.txt
needs.txt
reform_programs.txt
sprites.png
grants.lua
language (folder)
scripts (folder)
You don’t need to include all of them in your mod folder if you don’t want to.
materials.txt
This is where all the objects and rooms you want to put in go.
There’s a bunch of code that goes in here, but it’s not that complicated when you think about it.
BEGIN Object – tells the game you are about to show an object
Name – what you want to call your object for the purposes of referring to it later (later we are going to localise it so that it has a proper name in-game)
Research – any prerequisite research that has to be finished before this item will be available, otherwise it will be grayed out
RenderDepth – objects with a lower renderdepth will be rendered above objects with a higher renderdepth. A prisoner’s renderdepth is 2
AttachToWall – whether or not it grabs the wall like a metal detector
ConstructionTime – how long it takes to build something in realtime seconds
MoveSpeedFactor – how fast someone moves while carrying it as a percentage of their normal speed
Toughness – how much damage it can take (from fires or prisoners) before it is 100% broken
Price – a negative number indicating how much it costs to buy something
NumSlots – needs to be 3 for a processor or 1 for equipment
Group – which class of item it belongs to (e.g. StaticObject)
BlockedBy – something that you cannot place this item on
MadeOf – what this item is made of (wood is more flammable than composite)
Properties – special properties of this item (e.g. processor, scripted)
WorkGroup – indicates a group of materials, productionrules, and other such things that all belong to the same job cycle
Worker – who operates this
SpriteVariants – how many variations on the sprite there are (normally 1)
Width – how wide the object is
Height – how tall the object is
Sprite – which object in the game’s spritebank this item looks like (if there is no custom sprite)
BEGIN Sprite – tells the game that this item has a sprite from your sprites.png
x – where on the horizontal plane of your sprites.png the upper-left point of the desired sprite is
y – where on the vertical plant of your sprites.png the upper-left point of the desired sprite is
w – how wide the sprite is
h – how tall the sprite is
RotateType – different ways of rotating the sprite, e.g. 1 = four rotations and three sprites (forward, backward and left – left is mirrored to make right)
BEGIN Marker – for processors, shows where each marker is and for equipment, shows where it should be held
x – where, horizontally, on the desired sprite the marker will go
y – where, horizontally, on the desired sprite the marker will go
orientation.x – where the marker will be facing (left to right)
orientation.y – where the marker will be facing (left to right)
Index – which marker it is (0 = first, 1 = second, 2 = third etc.)
END – tells the game we are done with this specific marker
END – tells the game we are done with this sprite
END – tells the game we are done with this object
Oh right, i forgot.
Markers designate a point where equipment should be held, or three or more points on a processor where the input(s), worker, and output(s) should go.
On a normal processor, 0 is for the input, 1 is for the worker, and 2 is for the output.
In the world of Prison Architect, a room is classified as a material. It’s less complicated though:
BEGIN Room – tells the game we are starting a new room
Name – what you want to call the room for now (we’ll give it a proper name later)
WorkGroup – which group of objects, rooms, jobs, etc. this room belongs to for the purposes of deciding how to do a job
Properties – special attributes of this room (e.g. PrisonersCanWork)
Qualification – if prisoners can work here, which reform program they need to pass in order to be assigned work through the Logistics screen
Research – the research you need to do in order to build this room
BEGIN Requirement Type Indoor END – requires the room be indoors
BEGIN Requirement Type MinimumSize x y END – requires the room be a certain size
BEGIN Requirement Type Object Id END – requires the room have a certain object in it
BEGIN LikelyObject Id END – any items that will probably be in the room but don’t have to be
BEGIN Contraband Id END – any equipment prisoners can steal from the room
END – tells the game we are done with this room
production.txt
This is for anything that you want to use as a storage device or as a processor.
A processor is something that turns an input(s) into output(s).
There are two things that go into this: processors and production rules.
Let’s go over production rules first because they are less scary.
BEGIN ProductionRule – tells the game we are starting a new production rule
Rule – which type of production rule this is, generally it’s used for storage
Material – which item is subject to this rule
Container – for storage rules, where this item will be stored
Room – for objects present in multiple rooms (e.g. a table), specifies in which room the container must be
Distribution – how the containers will be chosen
WorkGroup – which group of items, rules, jobs, etc. this belongs to for the purposes of assigning jobs to do
Worker – who carries this out
Condition – extra conditions imposed on this rule
Properties – special properties of the rule
END – tells the game we’re done with this rule
And now for processors (slightly more scary):
BEGIN Processor – tells the game we are starting a new processor
Processor – which item is to be used as a processor
Room – for processors in multiple rooms (e.g. sorting desk), specifies which room the processor must be in in order to be classified as this type of processor
Input – which item this processor uses to make the output
InputCount – how many of the inputs you need (if it’s only one, don’t bother including this)
Output – which item the processor spits out
OperatingTime – how long in in-game minutes it takes to fix it
Properties – anything special this processor might have to do
Worker – who operates the processor
Qualification – which reform program the worker must have completed before they can use the processor
WorkGroup – which group of items, rules, jobs, etc. this belongs to for the purposes of assigning jobs to do
END – tells the game we are done with this processor
research.txt
This is where you put all the research you have to do in Bureaucracy.
It’s pretty straightforward.
BEGIN Research – tells the game we are starting new research
Name – what we will call this research internally – we will give it a name later
Type – what we will be unlocking with this (Ability or Entity depending on if it unlocks staff)
Requires – any prerequisite research
Admin – who does the research
Sprite – if you want to have the icon on here be an item from the game, put the item’s name here
Cost – a negative number indicating how much this will cost
Time – how many in-game minutes it will take to research
X – where it will be on the bureaucracy board (left to right)
Y – where it will be on the bureaucracy board (up or down)
END – tells the game we are done with this research
jobs.txt
This is also fairly straightforward to make:
BEGIN Job – tells the game we are starting a new job
Name – the internal name of this job, we will change it later
JobTime – how long it takes in in-game minutes to complete this job
Worker – who does this job
Qualification – if a prisoner is the worker, which reform programs they need to have passed
WorkGroup – which group of objects, rooms, jobs, etc. this job is a part of for the purposes of deciding who does what
END – tells the game we are finished with this job
See? That wasn’t so hard.
needs.txt
Here’s where you put all your new needs and where you designate items as providers for those needs.
First, the needs:
BEGIN Need – tells the game we are starting a new need
Name – what we will refer to this need as, we will give it a new name later
Priority – how important this need is (higher numbers here mean the need will be satisfied first)
MisbehaviourType – what the prisoner will do instead of FailureAction in response to the need going red
FailureAction – what will happen if this need goes unfulfilled for too long (going red)
TimeToAction – how long it will take for a prisoner to want to take action on this need in minutes (the need turns orange)
TimeToFailure – how long it will take for a prisoner to begin performing the failure action (the need turns red)
StartingActionPoints – How many base action points this prisoner has toward this need
RandomActionPoints – I don’t fully understand this, but I believe changing this number influences how long it takes for the need to turn yellow (i.e. when action points get too high, the prisoner begins to seek a remedy to this need).
Chance – how likely it is for any prisoner to have this need
Visibility – whether or not you can see it in your Needs tab
Properties – any special attributes this need has
END – tells the game we are finished with this need
There’s one more thing we include in needs.txt, and that is provider designations:
BEGIN Provider – tells the game we are starting a new provider
Action – what the prisoner is shown to be doing to provide for this need
ProviderType – how the need is fulfulled
Object – with which object the need is fulfilled with
Slot – which slot is used to provide for this need (normally 1)
PrimaryNeed – the first need provided for
PrimaryRate – a negative number indicating how rapidly the need is fulfilled
SecondaryNeed – the second need provided for
SecondaryRate – a negative number indicating how rapidly the need is fulfilled
ActionType – which type of action must be taken (normally Use)
Flags – extra conditions imposed on the provider
END – tells the game we are done with this provider
reform_programs.txt
This is one of the easier things to do, all that goes in this document is the reform programs you want to put in your mod.
Here we go:
BEGIN Program
Name – the internal name of the program (we will change this later)
SessionCost – a negative number indicating how much the program costs per session
Places – the maximum number of prisoners that can take part in the program
SessionLength – how many in-game minutes each session takes to complete
NumSessions – how many sessions it takes to pass/fail
Difficulty – how hard the program is (easy = 10, hard = 60)
Research – any prerequisite research that needs to be done in order to unlock this program
Room – where the program takes place
Teacher – which member of staff teaches the program
Equipment – which item each prisoner uses while participating in this program
Intake – voluntary or mandatory
Properties – special attributes of this program
WorkGroup – which group of objects, rooms, jobs, etc. this belongs to for the purposes of deciding who does what
END
language
Remember how I kept telling you we’d change the name of everything later? This is how we do it:
First, you need a text document named base-language.txt.
Next, you want to add every custom thing you put elsewhere into this document, in the following way (just as an example, let’s pretend you named everything “name”):
Objects – object_name, (buildtoolbar_popup_obj_name if buildable to add a tooltip)
Reform programs – reformprogram_name
Rooms – room_name, buildtoolbar_popup_room_name for a tooltip in the Rooms menu
Jobs – job_custom_name
Research – research_name, researchtooltip_name for a tooltip
Grants – objective_grant_name, objective_grant_name_description for a description, objective_grant_name_requirement1 for each requirement (change the number for each requirement)
Setting everything up in this way is called localisation.
scripts
This is for all the advanced stuff you presumably want to put in.
Before you can begin making scripts, you first need to add the Scripted property to any item you put in materials.txt, so the game knows to come looking here for a script of the same name and capitalisation of the object you are running a script through. Every script is written in lua and should be given the extension .lua.
For example, if you made an item called ScriptedStuff, you would add Properties Scripted to it’s materials.txt file and you would make a file named ScriptedStuff.lua.
Lua scripting is REALLY complicated, and I won’t go through it all here because that would take far too much space and time. If you are really stuck, try looking at [link] for information, or the good folks over at the Prison Architect forum/reddit may be willing to help out.
sprites.png
Ohhhh boy.
This is where you put all the custom sprites you want to use in your items. (Try to fit it all into a small space, there’s only a finite amount of space available for every mod to use and if a person runs too many mods with too big sprites.png files in them, you get weird corruptions happening, and nobody wants that.)
When you attach your sprites to an item, the game will use a grid-based system to find which sprite goes where. For this reason, circular sprites are a bit fiddly and may appear smaller than you designed them.
However, when making your sprites, you have to remember how you are going to let the player rotate your custom objects, and design sprites based around that using RotateTypes.
RotateType 0 only requires a front-facing sprite, and automatically generates the rest by rotating the sprite 90 degrees four times. It sounds easy, but the auto-generated sprites often look terrible.
RotateType 1 requires front-, back- and left-facing sprites, and flips the left-facing one to make a right-facing sprite. Using this, the sprites look much better when rotated.
RotateType 2 requires front- and left-facing sprites. The right-facing sprite is the left one flipped, and the back-facing sprite is just the front-facing sprite again.
RotateType 3 is very similar to RotateType 1, but works much better with objects that are rectangular.
RotateType 4 only needs one sprite to cover all four rotations, but that one sprite functions as all four rotations (i.e. the object cannot be rotated).
[link] has more in-depth information on RotateTypes, and also includes types 5 and 6 if you really want to use them.
grants.lua
Yes, that is a .lua you see instead of a .txt, and no, that’s not a mistake, nor does it belong in the scripts folder.
This is a lua script that tells the game to import your custom grants, and it’s probably the easiest .lua script you’ll make.
It is structured a bit differently, so let’s get to it:
For our purposes, we are going to create the “Example” grant which requires Example2 to have been researched, so you can just find and replace “Example” with whatever you want to put in here.
MAKE SURE you don’t have “Smart Quotes” or “Smart Dashes” enabled on your word processor.
function CreateGrants() — this is what we use to make our grant.
CreateExampleGrant()
end
function CreateExampleGrant()
Objective.CreateGrant ( “Grant_Example”, 5000, 5000 ) — the sum of every first number in the pair is the advance payment money, and the sum of every second number in the pair is the money you get on completion
Objective.SetPreRequisite ( “Completed”, “Grant_Example2”, 1 ) — this is where you put any grants that must be completed before this one shows up
Objective.CreateGrant ( “Grant_Example_Requirement1”, 0, 5000 ) — these two numbers contribute to the total advance payment and completion reward, as do every other two numbers in similar lines
Objective.SetParent ( “Grant_Example” ) — make sure you have this line for every new requirement you want
Objective.RequireRoom ( “ExampleRoom”, true ) — makes the grant need this room to be fulfilled
end
You can add similar 3 line pairs for every new requirement.
You don’t need to have Objective.RequireRoom specifically, you could replace it with:
Objective.RequireObjects ( “ExampleObject”, number ), this applies to objects and staff
Objective.RequirePrisonerCapacity(number)
Objective.RequireRoomsAvailable ( “ExampleRoom”, number ) really only used for unoccupied Offices
Objective.HiddenWhileLocked()
Objective.Requires ( “ExampleThing”, “Something”, number ) i don’t fully understand this one, but in the game files it is used for things like setting the minimum amount of dog patrols needed, or the amount of prisoners who need to pass a certain reform program
Objective.RequireResearched ( “ExampleResearch” )
Objective.RequireManufactures ( “ExampleItem”, number )
Objective.RequireTimePassed ( number ) the number is the time needed to pass in in-game minutes
Objective.RequireSetMeals (number)
This was a little more complicated than the others, but it is self-contained and doesn’t rely on any other file except base-language.txt to work.
Properties
Yes I kept talking about Properties for everything but I never said what properties you could have.
Well worry no more, for I have a list right here! These are all taken from the game files, and there may be some hidden ones I am unaware of, but this is a very thorough list.
Material – something that is used to make something else
StaticObject – the object won’t be moved and cannot have an object BlockedBy StaticObject be placed on top of it
Sellable – can be moved to exports through production.txt and exported for money
RoomSpecific – can only be built in a specific room (e.g. the Electric Chair)
WomenOnly – can only be built in a female prison
Electrical – needs electricity to function
Door – self-explanatory
CanPlaceOnRoad – be careful as it may block supply trucks etc.
BlockMovement – cannot be moved through by any entity
Window – self-explanatory
BuiltOnWall – can only be built on top of a wall (e.g. Shop Front)
SlowDelivery – is brought in by truck instead of teleported where it is needed
DontAvoid – entities will ignore it when pathfinding
RadiatesHeat – emits heat, must also have a RadiantTemperature line in it’s description
Rubbish – will be automatically dumped
Entity – is a living, breathing human/dog
Staff – is a staff member of your prison and can be hired through the Staff menu
Guard – is a guard, kinda buggy
DoesNotTire – won’t be exhausted, ever
Administrator – can research things, needs an Office to work
Vehicle – vroom vroom
Utility – can be built through the Utilities menu
ExplodesWhenWet – kaboom
Wired – can connect to other objects through Utilities
Processor – does something in production.txt
MobileObject – can be moved around
ShelfObject – can be put on a shelf
Uncloneable – cannot be cloned in the Clone menu
CutsceneMarker – is used in a campaign to begin a cutscene
Housing – prisoners can live in here, counts toward capacity
QualityGraded – has a quality grading out of 10, don’t know if it’ll work with a mod
WomenOnly – can only be built in a women’s prison
MothersOnly – can only be used by mothers
RequiresSector – has to be it’s own sector in Deployment
DiningArea – meals can be delivered here
PrisonersCanWork – prisoners can be assigned to work in this room through Logistics
BlockMaterialTransfer – prevents workmen from moving building materials through it (?)
Weapons – is classified as a weapon in Intelligence, can be used to attack
NoImport – cannot be smuggled in or thrown over the walls
Improvised – is made in a room, not sure what the effect is
Metal – sets off a metal detector
Tools – is classified as a tool in Intelligence, can be used to dig tunnels
Narcotics – is classified as narcotics in Intelligence, can make prisoners High or Overdosed
Luxuries – is classified as a luxury in Intelligence
Smelly – dogs can detect it
RangedWeapon – can be used over a distance, should be coupled with an Ammo line
AutoCharge – is constantly rising
Involuntary – rises outside of the control of a prisoner
RaisesTemp – increases the danger level of a prison
Practical – only prisoners with the “Practical” trait can enrol
Academic – only prisoners with the “Clever” trait can enrol
CanHireExternally – can hire teachers from outside the prison
StudentsSit – participating prisoners will sit down during the program
TeachersSit – teachers will sit down during the program instead of wandering the room
Repeatable – can be passed several times
Passive – i don’t know
StaffOnly – prisoners are ineligible
OutsideOfWork – can be done outside of “Work” regime time
CanEscortStudent – guards can take prisoners to the program manually
There might be some hidden extra ones but these were all I was able to find in the prison architect data.