Modding (i.e. creating Mods) is a fun pastime and can be used to expand and enhance the gaming experience of Prison Architect.
- Here is a list of all possible properties and values that can be used in mod data files: ModSchema.
- This is a reference or guide explaining rotate types: RotateTypes Explained.
- Here is a guide: Modding Quickstart Guide.
- For more information on developing scenario mods, see Lua.
- An extensive guide about object scripting can be found on Steam (aubergine18).
- More help can be found in the in the Prison Architect Modding forum.
- Windows users can find this folder at:
- Mac users can find this folder at:
/Users/Username/Library/Application Support/Prison Architect/mods
- Linux users can find this folder at:
Mods should contain a manifest.txt detailing the name, author, date, and version. A thumbnail.png can also be provided and is optional. This is the image that will display to users when they view it in-game.
Here are two official SAMPLE mods, showing how to put mods together correctly:
- Example of a graphical mod that replaces all object sprites: Media:Sample_Graphical_Mod.zip
- Example of a scenario mod that uses Lua scripts to run story cut-scenes: Media:Sample_Scenario_Mod.zip
More detailed instructions can be found in this topic in the Prison Architect developer forums: http://forums.introversion.co.uk/viewtopic.php?f=43&t=45950
Using a tool such as WinRar or 7-zip, extract the contents of the 'main.dat' file, found in your 'prison architect' folder, to the same directory. You will now have a 'data' folder. This is doing the same job as the 'main.dat' file, but is being loaded as an addition to the already loaded files. Any changes you make here will affect the game. You may want to repeat this process with the 'sounds.dat' file as well.
Any file that is in these files will be loaded after the original game file is loaded, and will overwrite the files from the game in the memory. This will NOT overwrite the original files, and will only be an addition to the already loaded content. This means for example that e.g. if you are missing some new translation lines in your base-language.txt file, the English text will be loaded from the original file.
You can also define new objects, entities, items, materials, rooms, research, programs, grants, jobs, production rules, needs and need providers, and load your own sprites (please keep your sprites.png as small/compact as possible - so more mods can be loaded at once).
Extra note: If there are multiple mods active, the last one loaded will have the highest priority. This means that if there are multiple mods that are translating the game, the mod that is loaded the last will take precedence over the other mods.
For information about the internal structure of many files found in main.dat, see File Format.
The Steam Workshop can now be used to share mods.
To make a translation for the game, you need to edit base-language.txt found in data/language.
Using Multiple Grant ModsEdit
- Use 7-zip to extract "Main.dat" (you can download 7-zip from here).
- Open the new created "main" folder.
- Open "grants.lua" (a Lua IDE can be downloaded from this SourceForge link, but Lua scripts can be edited in every text editor as well).
- Copy the modified lines from both of the Grant mods.
- Paste them in the "Grant.Lua" inside the "main" folder.
- Go to Prison Architect > Main > Language and open "base-language.txt".
- Repeat Step 4.
- Paste them (the lines) inside "base-language.txt" on the: "Objectives, Grants" Section of the .txt (near the end)
Opening The Debug ConsoleEdit
To print some debugging output, call the following inside your Lua script:
As opposed to when errors happen with your script, this does not automatically open the debug console. To do so, press F3 when the modified object is selected (every object has its own debug console).
Saves are made in .prison files which can be easily edited in any text editor.
Some reverse engineering work has been done on the internals of the game. This has been done before Prison Architect had official support for mods, but still may be useful for modders that wish to alter core game functionality, or provide bolt-on tools. At least Linux versions are distributed without stripping symbols, but much of the debug features are stubbed out with rep retn, so there is little hope of getting the neat debug window from the videos. However, it's likely possible to patch the renderer to render, for example, the red area where stuff is thrown into the prison with little effort.
If the Windows version is not shipped with symbols, it might be possible to use bindiff to map the symbols from the Linux version to Windows.
Right now, the following is known:
- Most of the prisoner structure (position, velocity, destination, age, name, health, assigned cell ID, gang ID)
- Most of the prisoner needs structure (need type, current level, max level, time to max level, time to failure)
- Some of the actor type constants.
- The list of need type constants.
- Float loading code offset for money (used to leak money address on heap)