Prison Architect

Prison Architect

152 ratings
How to create mods
By Anky Painter
I will be showing you how to create mods like campagins, grants, objects and more. This used to be call how to make a grant, but because there have adding all these things that support modding i have renamed it to how to make a mod and i will be showing you how to al sorts of mods.
4
   
Award
Favorite
Favorited
Unfavorite
1. Setting Up
You will need:
  • Notepad++: Click here [notepad-plus-plus.org] to download notepad++.
  • Winrar: Click here [www.rarlab.com] to download winrar.

Before we can start creating our mod, we need to create some files.

1. First we need to locate the Prison Architect file.
It should be here here: "C:\Program Files\Steam\SteamApps\common\Prison Architect"
2. After you have locate your Prison Architect folder. You need to open the "main.dat file with winrar.
3. You will need to make a file on your desktop called "Main Data".
4. Go back to the main.dat file and click on "data". You should now see lots of files.
5. Copy all the ".txt", ".lua" and all folders into the "Main Data" file. after that close the "main.dat" file.
6. You need to locate the Prison Architect Modding folder. The location of the modding should be here: "C:\Users\YourUserName\AppData\Local\Introversion\Prison Architect".
7. Open up the "mods" folder and create a new file. Call this what ever your mod is called.
8. Now open it up and create another folder called "data". Then create a text file called "manifest.txt".
9. You need to add a picture to this file called "thumbnail.png". I like to add just any picture for a temp thumbnail.

Now before i can let you move on we need to edit the "manifest" file. So copy the code below into the "manifest" file.

Name "Mod Name" Author "Author Name" Description "Description goes here." Version "v1.0" Date "1/12/2013" URL "www.prison-architect.com"

The code above is really easy to understand. So you are free to move on to how to create a mod.
2. Sandbox Mod
In this section i will be showing you how to create a sandbox mod. This mod makes a grant that gives you $100,000,000 and also you can build every thing instantly.

In this mod i will be showing you to edit the "grants.lua", "materials.txt" and the "language.txt" files. So lets get started.

First want we want is to create a grant. To do this we just go into the "data" folder and create a file called "grants.lua". After you done that copy the code below and place it into the "grants.lua"

function CreateGrants() -- This calls the function 'CreateSandboxGrant' CreateSandboxGrant(); end function CreateSandboxGrant() -- Sandbox Mode -- -- This creates the sandbox grant. -- String is the grants name. -- First number is how much you get from accepting the grant. -- Second number is how much you get from Finishing the grant. Objective.CreateGrant ( "Grant_Sandbox", 100000000, 0 ) -- This is the same thing then above but this creates the sub grant. -- Sub grant is a grant but inside of another grant. Objective.CreateGrant ( "Grant_Sandbox_Deliveries", 0, 0 ) -- This sets what grant this sub grant is apart of. -- For me i want the sub grant to be apart of the sandbox grant. -- So we put the name of the grant we made above in the string. Objective.SetParent ( "Grant_Sandbox" ) -- This creates the room you need to finish the grant, -- The string is the room name. If you want you can change -- The RequireRoom to RequireRoomsAvailable, so then the -- User has to build x amount of these rooms to complete the grant Objective.RequireRoom ( "Deliveries", true ) end

I have went through and commented it so you can understand what every thing does. The code below is a example of a grant where you have to do multiple objectives in order to complete the grant.

This grant is taken from the "grants.lua" file from the "main.dat" file.
function CreateBootstrapGrants() -- Basic Detention Centre Objective.CreateGrant ( "Grant_bootstraps", 40000, 0 ) Objective.CreateGrant ( "Grant_bootstraps_holdingcell", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireRoom ( "HoldingCell", true ) Objective.CreateGrant ( "Grant_bootstraps_shower", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireRoom ( "Shower", true ) Objective.CreateGrant ( "Grant_bootstraps_yard", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireRoom ( "Yard", true ) Objective.CreateGrant ( "Grant_bootstraps_kitchen", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireRoom ( "Kitchen", true ) Objective.CreateGrant ( "Grant_bootstraps_canteen", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireRoom ( "Canteen", true ) Objective.CreateGrant ( "Grant_bootstraps_guard", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireObjects ( "Guard", 2 ) Objective.CreateGrant ( "Grant_bootstraps_chef", 0, 0 ) Objective.SetParent ( "Grant_bootstraps" ) Objective.RequireObjects ( "Cook", 2 ) -- Basic Administrative set up Objective.CreateGrant ( "Grant_Administration", 10000, 0 ) Objective.CreateGrant ( "Grant_Administration_offices", 0, 0 ) Objective.SetParent ( "Grant_Administration" ) Objective.RequireRoomsAvailable ( "Office", 2 ) Objective.CreateGrant ( "Grant_Administration_Warden", 0, 0 ) Objective.SetParent ( "Grant_Administration" ) Objective.RequireObjects ( "Warden", 1 ) Objective.CreateGrant ( "Grant_Administration_Accountant_Research", 0, 0 ) Objective.SetParent ( "Grant_Administration" ) Objective.RequireResearched ( "Finance" ) Objective.CreateGrant ( "Grant_Administration_Accountant", 0, 0 ) Objective.SetParent ( "Grant_Administration" ) Objective.RequireObjects ( "Accountant", 1 ) end

So i hope you have learnt how to make your own grants. Now on to editing the "materials.txt" file.

I want you guys to locate the "materials.txt" file, then copy it into your "data" folder and open it up. Now this file has a lot of lines of code in it so i am not going to tell you to copy it below. Instead i would like to go through this slow with you.

Okay so first scroll down until you see this.
BEGIN Object Name Bed Height 2 ConstructionTime 3.00000 MoveSpeedFactor 0.500000 Toughness 30.0000 Price -200 NumSlots 2 AttachToWall true Group StaticObject BlockedBy Wall BlockedBy StaticObject BlockedBy UtilityStation Sprite Bed MadeOf Wood ToolbarSprite BedToolbar Properties StaticObject END
3, 1, 10, 7, 15
Name = the name of the object.
Height = the hight of the object
ConstructionTime = How long it takes to build the object.
MoveSpeedFactor = How much the workers move with the object.
Toughness = How strong the object is.
Price = How much the object cost.
NumSlots = How much slots it takes up.
AttachToWall = Attach the object to a wall.
Group = The group of the object.
BlockedBy = What the object gets blocked by.
Sprite = The sprite of the object.
MadeOf = What is the object made of.
ToolbarSprite = The toolbar sprite of the object.
Properties = What properties does the object have.

If you can play round with this settings to understand them a little better. So lets move on to how to make a object build instantly.To do this find the object option called "ConstructionTime" and set it to "0.00000". Now you need to go through each object and set the "ConstructionTime" to "0.00000", but that will take a while so there is a better way.

The better way is to use the "find and replace with". You do this by pressing "ctrl+f" and goiing to the replace tab. Okay so you need to frist type "ConstructionTime 3.00000" into the "find" box and then type "ConstructionTime 0.00000" into the replace box. Now press "Replace All" and this time instead of "3.00000" type "7.00000" and press the button again. Now keep doing this with "1.00000", "10.00000","15.00000". and "20.00000".

So that is the "material.txt". Now to move on to the last file to edit. so open up the the "Main Data" folder, then look for the "language" folder and copy that into your "data" folder. Now open up the "language" and then open up the "language.txt".

The only reason we are editing this file is so we can add a name and a description to our grant/s.
So go ahead and delete everything in that "language.txt" file and copy the code below.

# ============================================================================= # Objectives, Grants # ============================================================================= objective_grant_sandbox Sandbox - The name. objective_grant_sandbox_description This will give you $100,000,000. - The description. objective_grant_sandbox_deliveries Build a deliveries zone - This will show up in the todo list.

After you have done all of that load up the mod and test it out. Remeber to add a thumbnail.
If you have any problems with this, please leave a comment below and i will try to help you.

More tutorials coming soon
3. Campaign Mod
In this section i will be showing you how to create your own campaign. I'm only going to be creating a basic one for this tutorial but i will teach you all you need to know to create much more advance campaign mods. So lets begin.

First you need to make 2 folders, a "campaign" and a "language" folder. Next open up the "campaign" folder, create a folder called "chapter_name" and a file called "start.lua". In the "start.lua" file copy and paste the code below in the file.

function Begin() -- This loads the first chapter. Game.SetChapter ( "chapter_name" ) end

Now save that and lets move on to the "chapter_name" folder. Lets go ahead, open up "Prison Architech", create a prison for the campaign and call it "campaign mod". Now lets open up the "saves" folder, find the your prison that you have just save and then move it to "chapter_name" folder. Now lets create a file called "script.lua" and open it up. Copy and paste the code below into the "script.lua" file.

function BeginChapter() Intro() end function Intro() Game.SetMap ( "campaign mod" ) Game.FadeToBlack ( 0, false ) Game.Sound ( "_Music", "DeathRowIntro" ) Game.FadeUp ( 3, false ) Game.Pause ( 3 ) Game.AdviserIncoming ( "Ceo" ) Game.AdviserSayBatch ( "Ceo", "campaignmod_intro" ) Game.Pause ( 1 ) Game.AdviserSay ( "Ceo", "campaignmod_intro_continue" ) end

Commented version below

function BeginChapter() Intro() end function Intro() -- Loads up the first map. Game.SetMap ( "forest" ) -- Makes the screen fade to black. Game.FadeToBlack ( 0, false ) -- What sound or music to play Game.Sound ( "_Music", "DeathRowIntro" ) -- Increases the volume of the music or sound. Game.FadeUp ( 3, false ) -- Pause the game for x amount of seconds. Game.Pause ( 3 ) -- Shows you the CEO(or Doctor, Leftwing, Rightwing, -- SecurityChief and Warden) calling you. Game.AdviserIncoming ( "Ceo" ) -- The adviser say all lines 1 to 3 from the 'base-language.txt' file. Game.AdviserSayBatch ( "Ceo", "campaignmod_intro" ) -- Pause the game for x amount of seconds. Game.Pause ( 1 ) -- Adviser say one line from the 'base-language.txt' file Game.AdviserSay ( "Ceo", "campaignmod_intro_continue" ) end

Game.SetMap = Loads up the first map.
Game.FadeToBlack = Fades the screen to black.
Game.Sound = Plays a sound or some music.
Game.FadeUp = Incressing the brightness or volume of a sound.
Game.Pause = Pauses the game for some time.
Game.AdviserIncoming = Shows one of the advisers.
Game.AdviserSayBatch = Say all of the phrases, 1 to 3 in the "base-language.txt" file.
Game.AdviserSay = Say a single phrase, in the "base-language.txt" file.

Now lets go back to the "data" folder and open up the "language" folder. In this folder create a file called "base-language.txt", copy and paste the code below into the file.

# Strings for the campaign mod campaignchapter_chapter_name Your campaign mod (chapter) name here. campaignmod_intro_1 Hello and welcome to a short cut-scene. campaignmod_intro_2 This is where you create your strings for your mod. campaignmod_intro_3 It's very easy to create strings like this. campaignmod_intro_continue The end of this short cut-scene.

After you have done that open up "Prison Achitect" and load up your mod. See if it works before going on to the next steps, also i want you guys just to see what happens when you delete some lines and move stuff around before moving on.

Coming soon.
94 Comments
Dank Oct 11, 2022 @ 5:23pm 
@ _Laken I dont know how to make one in this game but I do know how to in real life if your still interested
NorthWestTrees Jul 2, 2021 @ 10:44pm 
I have some experience with making mods throw settings based format Starbound uses a similar method for modding. However one thing I am not sure on from browsing the first section of the tutorial was if I need to override the file with the base game content or if I can just add the content under the same name. Starbound had a system that you replaced existing code but it was not required to include the base stuff. Is this the same with this game or would I need to include all the game content as well. I imagine it would have conflict with other mods if one where to use base game content. But I am new so I though I would ask to help me learn a bit more before I dig a bit deeper into the modding. Also thank you for the tutorial it is very useful to me so far :)
Fuchsium Mar 22, 2021 @ 2:00pm 
cringe notepad++ vs based visual studio
GoAETx Apr 18, 2020 @ 12:35pm 
Thx that was really helpfull
jess Jul 6, 2019 @ 12:21am 
To overwrite a sprite just copy the relevant sprite sheet from main.dat to your mods folder and edit it in a photo editor.
mstrrer Nov 22, 2016 @ 6:27pm 
this was very helpful but in the making of my campaign i had to do homework :(
Balthasar Gelt Nov 13, 2016 @ 8:55am 
Got any idea how to make a nuclear reactor mod?
Democracy Officer Nocheese4u Aug 20, 2016 @ 8:37pm 
I want to make an alarm that replaces the default lockdown alarm, where would I begin for this?
🌌ComradeGalaxy🌌 Aug 9, 2016 @ 11:48am 
Thanks)
Eman Mar 11, 2016 @ 3:25pm 
Hi I am 13 and just received my Btech for building a PC and doing a power point on it I am interested in doing some coding or modding files I just got prison architect and want to modify it a bit in the morning I'm going to attempt it tomorrow and would love if you could help me if I have any questions