Brought to you by PCGamingWiki

Modding guide

From Prison Architect Wiki
Jump to: navigation, search

Modding is when you change a gameplay element, such as:

  • Grants
  • Pictures (e.g prisoner clothing, objects, terrain)
  • Save games

Code[edit]

Example Code[edit]

function CreateGrants()

	CreateBootstrapGrants();
	CreateFirstCellBlockGrant();
	CreateHealthGrant();
	CreateBookWormsInmatesGrant();
	CreateHigherSecurity();
	CreateFamilyMatters();
	CreateMetalDetectors();
	CreateExercice();
	CreateWaterLand();
	CreateVisitation();
	CreateLaundromat();
	CreateWorkshop();
	CreateModInstall();
	--Input new grants here
	CreateSmallPrison();
	CreateMediumPrison();
end



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



function CreateFirstCellBlockGrant()

	Objective.CreateGrant			( "Grant_FirstCellBlock", 20000, 10000 )
		
	Objective.CreateGrant			( "Grant_FirstCellBlock_Cells", 0, 0 )
	Objective.SetParent				( "Grant_FirstCellBlock" )	
	Objective.RequireRoomsAvailable	( "Cell", 15 )
	
end


function CreateHealthGrant()

	Objective.CreateGrant			( "Grant_Health", 10000, 10000 )
	
	Objective.CreateGrant			( "Grant_Health_Ward", 0, 0 )
	Objective.SetParent				( "Grant_Health" )
	Objective.RequireRoom			( "MedicalWard", true )
	
	Objective.CreateGrant			( "Grant_Health_Doctors", 0, 0 )
	Objective.RequireObjects		( "Doctor", 2 )
	Objective.SetParent				( "Grant_Health" )
	
	Objective.CreateGrant			( "Grant_Health_Psychologist", 0, 0 )
	Objective.RequireObjects		( "Psychologist", 1 )
	Objective.SetParent				( "Grant_Health" )
	
end

	--Added by Adico:

function CreateBookWormsInmatesGrant()


	Objective.CreateGrant			( "Grant_Book_Worms_Inmates", 2000, 1000 )

	Objective.CreateGrant			( "Grant_Book_Worms_Inmates_Commonroom", 0, 700 )
	Objective.SetParent				( "Grant_Book_Worms_Inmates" )
	Objective.RequireRoom			( "CommonRoom", true )
	
	Objective.CreateGrant			( "Grant_Book_Worms_Inmates_Books", 0, 0 )
	Objective.RequireObjects		( "Bookshelf", 3 )
	Objective.SetParent				( "Grant_Book_Worms_Inmates" )
	
	Objective.CreateGrant			( "Grant_Book_Worms_Inmates_Chairs", 0, 0 )
	Objective.RequireObjects		( "Chair", 2 )
	Objective.SetParent				( "Grant_Book_Worms_Inmates" )

end

function CreateHigherSecurity()

	Objective.CreateGrant			( "Grant_Higher_Security", 25000, 5000 )
	
	Objective.CreateGrant			( "Grant_Higher_Secutiry_1", 0, 500 )
	Objective.SetParent				( "Grant_Higher_Security" )
	Objective.RequireResearched		( "Security" )
	
	Objective.CreateGrant			( "Grant_Higher_Secutiry_2", 0, 500 )
	Objective.SetParent				( "Grant_Higher_Security" )
	Objective.RequireResearched		( "Deployment" )
	
	Objective.CreateGrant			( "Grant_Higher_Secutiry_3", 0, 500 )
	Objective.SetParent				( "Grant_Higher_Security" )
	Objective.RequireResearched		( "Cctv" )
	
	Objective.CreateGrant			( "Grant_Higher_Security_Room", 0, 1000 )
	Objective.SetParent				( "Grant_Higher_Security" )
	Objective.RequireRoom			( "Security", true )
	
	Objective.CreateGrant			( "Grant_Higher_Security_Guards", 0, 500 )
	Objective.RequireObjects		( "Guard", 10 )
	Objective.SetParent				( "Grant_Higher_Security" )
	
	Objective.CreateGrant			( "Grant_Higher_Security_CCTV_monitors", 0, 100 )
	Objective.RequireObjects		( "CctvMonitor", 1 )
	Objective.SetParent				( "Grant_Higher_Security" )
	
	Objective.CreateGrant			( "Grant_Higher_Security_CCTV", 0, 500 )
	Objective.RequireObjects		( "Cctv", 3 )
	Objective.SetParent				( "Grant_Higher_Security" )
	
end

function CreateFamilyMatters()

	Objective.CreateGrant			( "Grant_Family_Matters", 10000, 0 )
	
	Objective.CreateGrant			( "Grant_Family_Matters_Phones", 0, 0 )
	Objective.RequireObjects		( "PhoneBooth", 5 )
	Objective.SetParent				( "Grant_Family_Matters" )
	
end

function CreateMetalDetectors()
	
	Objective.CreateGrant			( "Grant_Metal_Detectors", 20000, 5000 )
	
	Objective.CreateGrant			( "Grant_Metal_Detectors_MT", 0, 1000 )
	Objective.RequireObjects		( "MetalDetector", 6 )
	Objective.SetParent				( "Grant_Metal_Detectors" )
	
end

function CreateExercice()

	Objective.CreateGrant			( "Grant_Exercice", 500, 500 )
	
	Objective.CreateGrant			( "Grant_Exercice_1", 0, 500 )
	Objective.SetParent				( "Grant_Exercice" )
	Objective.RequireResearched		( "Maintainance" ) 
	
	Objective.CreateGrant			( "Grant_Exercice_2", 0, 500 )
	Objective.SetParent				( "Grant_Exercice" )
	Objective.RequireResearched		( "GroundsKeeping" ) 
	
	Objective.CreateGrant			( "Grant_Exercice_Benchs", 0, 200 )
	Objective.RequireObjects		( "WeightsBench", 4 )
	Objective.SetParent				( "Grant_Exercice" )
	
end

function CreateSmallPrison()

	Objective.CreateGrant			( "Grant_Small_Prison", 0, 20000 )
	
	Objective.CreateGrant			( "Grant_Small_Prison_Inmates", 0, 0 )
	Objective.RequireObjects		( "Prisoner", 20, "prisoner" )
	Objective.SetParent				( "Grant_Small_Prison" )
	
end
	
function CreateMediumPrison()

	Objective.CreateGrant			( "Grant_Medium_Prison", 0, 50000 )
	
	Objective.CreateGrant			( "Grant_Medium_Prison_Inmates", 0, 0 )
	Objective.RequireObjects		( "Prisoner", 50, "prisoner" )
	Objective.SetParent				( "Grant_Medium_Prison" )
	
end

--Added by LDshadowLord
function CreateWaterLand()

	Objective.CreateGrant			( "Water_Land", 2500, 1500 )
	
	Objective.CreateGrant			( "Water_land_pump", 0, 5000 )
	Objective.RequireObjects		( "WaterPumpStation", 1)
	Objective.SetParent				( "Water_Land" )
	
	Objective.CreateGrant			( "Water_land_drain", 0, 1000 )
	Objective.RequireObjects		( "Drain", 2)
	Objective.SetParent				( "Water_Land" )
	
	Objective.CreateGrant			( "Water_land_sh", 0, 500 )
	Objective.RequireObjects		( "ShowerHead", 2)
	Objective.SetParent				( "Water_Land" )
	
	Objective.CreateGrant			( "Water_land_room", 0, 500 )
	Objective.SetParent				( "Water_Land" )
	Objective.RequireRoom			( "Shower", true)
	
end

function CreateLaundromat()

	Objective.CreateGrant			( "Grant_Laundromat", 1000, 500 )
	
	Objective.CreateGrant			( "Grant_Laundromat_1", 0, 1000 )
	Objective.SetParent				( "Grant_Laundromat" )
	Objective.RequireResearched		( "PrisonLabour" ) 
	
	Objective.CreateGrant			( "Grant_Laundromat_Machines", 0, 1000 )
	Objective.RequireObjects		( "LaundryMachine", 2 )
	Objective.SetParent				( "Grant_Laundromat" )
	
	Objective.CreateGrant			( "Grant_Laundromat_Baskets", 0, 500 )
	Objective.RequireObjects		( "LaundryBasket", 2 )
	Objective.SetParent				( "Grant_Laundromat" )
	
	Objective.CreateGrant			( "Grant_Laundromat_Room", 0, 500 )
	Objective.SetParent				( "Grant_Laundromat" )
	Objective.RequireRoom			( "Laundry", true)
	
end

function CreateWorkshop()

	Objective.CreateGrant			( "Grant_Workshop", 1000, 500 )
	
	Objective.CreateGrant			( "Grant_Workshop_1", 0, 1000 )
	Objective.SetParent				( "Grant_Workshop" )
	Objective.RequireResearched		( "PrisonLabour" ) 
	
	Objective.CreateGrant			( "Grant_Workshop_Press", 0, 1000 )
	Objective.RequireObjects		( "WorkshopPress", 2 )
	Objective.SetParent				( "Grant_Workshop" )
	
	Objective.CreateGrant			( "Grant_Workshop_Saw", 0, 500 )
	Objective.RequireObjects		( "WorkshopSaw", 2 )
	Objective.SetParent				( "Grant_Workshop" )
	
	Objective.CreateGrant			( "Grant_Workshop_Room", 0, 500 )
	Objective.SetParent				( "Grant_Workshop" )
	Objective.RequireRoom			( "Workshop", true)
	
end

function CreateVisitation()

	Objective.CreateGrant			( "Grant_Visitation", 1000, 500 )
	
	Objective.CreateGrant			( "Grant_Visitation_Table", 0, 500 )
	Objective.RequireObjects		( "VisitorTable", 2 )
	Objective.SetParent				( "Grant_Visitation" )
	
	Objective.CreateGrant			( "Grant_Visitation_Room", 0, 500 )
	Objective.SetParent				( "Grant_Visitation" )
	Objective.RequireRoom			( "Visitation", true)
	
end

function CreateModInstall()
	
	Objective.CreateGrant			( "Grant_Mod_Installed", 500, 500 )
	
	Objective.CreateGrant			( "Grant_Mod_Installed_1", 0, 0 )
	Objective.RequireRoom		( "Deliveries", 1 )
	Objective.SetParent				( "Grant_Mod_Installed" )
	
end

Modifying your save game[edit]

Step 1: Save Game location[edit]

For Windows Vista/7/8 Navigate to: C:\Users\YOUR_NAME\AppData\Local\Introversion\Prison Architect\saves

For Mac Navigate to: /Users/YourUserName/Library/Application Support/Prison Architect/saves

For Windows XP Navigate to: C:\Documents and Settings\YOUR_NAME\Local Settings\Application Data\Introversion\Prison Architect\saves

Step 2: Accessing the save[edit]

Look for a file with .prison at the end, With your prison name infront. e.g. MyPrison.prison. Right Click that file and open with notepad, or for mac Textedit or other text editors.

Step 3: Modifying the save[edit]

Money Cheat[edit]

Once open, Press Ctrl + F, or for mac Command + F. Then type in the following: Balance. The following number should match your current money, change it to whatever you like and save the file.

Prisoner Cheat[edit]

Once open, the top few lines of the file will say "TimeIndex xyz" and a little bit below it will say "Intake.next zyx", modify zyx so that it is 1 higher than xyz to have prisoners arrive instantly
Below "Intake.next" is "Intake.numPrisoners", change that to whatever number you like

Once done, save the file and load up your save game.

Modifying the Game Files[edit]

Getting the Game Files (Windows)[edit]

  • Navigate to your installation directory e.g "C:\Program Files (x86)\Prison Architect\"
  • Open main.dat with an archive program such as WinRAR (WARNING: Do not use 7zip! It has problems with permissions and will not let you save.)
  • Extract it and rename it to "data", so the "grants.lua" file should be at "INSTALL_DIRECTORY\data\grants.lua"

Creating a Grant (Windows)[edit]

Open "grants.lua" with a text editor (I recommend Notepad++, but notepad is sufficient) and then make a new line anywhere between "function CreateGrants()" and "end"

type "CreateMyGrant();", it should now look like this:

function CreateGrants()
	CreateBootstrapGrants();
	CreateFirstCellBlockGrant();
	CreateHealthGrant();
	CreateMyGrant();
end

Directly after CreateGrants "end" line, create a new line and type "function CreateMyGrant()", followed by a new line with "end", like this:

function CreateMyGrant()
end

Inbetween those lines, press the TAB key once (its above capslock) and type "Objective.CreateGrant", followed by 3 more TAB's, and then "( "Grant_MyGrant", 1337, 42 )", like so:

function CreateMyGrant()
	Objective.CreateGrant			( "Grant_MyGrant", 1337, 42 )
end

"Grant_MyGrant" is the internal name of the grant, the actual name of the grant can be modified in the english.txt file, within the language folder, within the data folder, which we'll get to later

1337 is the amount of money you get from accepting the grant, 42 is the money you get once all grant requirements are complete (and doesn't include extra money from completing those requirements)

Now save the file and start up the game, go to the grants screen and you should see it there with its internal name "Grant_MyGrant", click it and you should get the money, if you don't go back and double-check it against my example.

Let's add a requirement, every requirement in a grant is a grant of its own, to make it a requirement we have to call "Objective.SetParent(Parent_Internal_Name_Here)" after creating it, like so:

function CreateMyGrant()
	Objective.CreateGrant			( "Grant_MyGrant", 1337, 42 )
	
	Objective.CreateGrant			( "Grant_MyGrant_MyRequirement1", 0, 8001 )
	Objective.SetParent			( "Grant_MyGrant" )
end

The number 8001 is the money you get when the grant, or in this case the requirement since we set its parent, is complete.

While it is now 'technically' a requirement, the requirement itself requires nothing, so let's change that.

scroll down this page and take a look at the Lua Scripting->Dump->Objective section and pick something meaningful from there (or just follow along), in this case I'll use "Objective.RequireRoom", you can take a look at the Rooms available to pick from in the Lua Scripting->Objects->Rooms section below, we'll do Solitary simply because it has no requirement itself (e.g be indoors) which is perfect for testing.

So after you set the parent, type in "Objective.RequireRoom ( "Solitary", true )", it should now look like this:

function CreateMyGrant()
	Objective.CreateGrant			( "Grant_MyGrant", 1337, 42 )
	
	Objective.CreateGrant			( "Grant_MyGrant_MyRequirement1", 0, 8001 )
	Objective.SetParent			( "Grant_MyGrant" )
	Objective.RequireRoom			( "Solitary", true )
end

Congratulations, you just made a basic grant, you can keep adding requirements, change the names, how much money you earn, etc. to your hearts content, save the file and run the game to test it out, if it doesn't work go back and compare it to my examples.

Getting the Game Files (Mac)[edit]

  • Navigate to library 'For Steam buyers"/Users/YourUsername/Library/Application Support/steam/steamapps/Common/Prison Architect/Prison Architect.app(to get inside it right click on it and click show package contents)/Contents/Resources"
  • Extract the file main.dat with and archive program ,not Compress, such as WinRAR Mac, or 7-Zip mac
  • Rename it to "data"

Creating a Grant (Mac)[edit]

Open the file grants.lua with textmate which is a free code editor for mac, or any other text editor like TextEdit, then make a new line anywhere between "function CreateGrants()"

type "CreateMyGrant();", it should now look like this:

function CreateGrants()
	CreateBootstrapGrants();
	CreateFirstCellBlockGrant();
	CreateHealthGrant();
	CreateMyGrant();
end

Directly after CreateGrants "end" line, create a new line and type "function CreateMyGrant()", followed by a new line with "end", like this:

function CreateMyGrant()
end

Inbetween those lines, press the TAB key once (its above capslock) and type "Objective.CreateGrant", followed by 3 more TAB's, and then "( "Grant_MyGrant", 1337, 42 )", like so:

function CreateMyGrant()
	Objective.CreateGrant			( "Grant_MyGrant", 1337, 42 )
end

"Grant_MyGrant" is the internal name of the grant, the actual name of the grant can be modified in the english.txt file, within the language folder, within the data folder, which we'll get to later

1337 is the amount of money you get from accepting the grant, 42 is the money you get once all grant requirements are complete (and doesn't include extra money from completing those requirements)

Now save the file and start up the game, go to the grants screen and you should see it there with its internal name "Grant_MyGrant", click it and you should get the money, if you don't go back and double-check it against my example.

Let's add a requirement, every requirement in a grant is a grant of its own, to make it a requirement we have to call "Objective.SetParent(Parent_Internal_Name_Here)" after creating it, like so:

function CreateMyGrant()
	Objective.CreateGrant			( "Grant_MyGrant", 1337, 42 )
	
	Objective.CreateGrant			( "Grant_MyGrant_MyRequirement1", 0, 8001 )
	Objective.SetParent			( "Grant_MyGrant" )
end

The number 8001 is the money you get when the grant, or in this case the requirement since we set its parent, is complete.

While it is now 'technically' a requirement, the requirement itself requires nothing, so let's change that.

scroll down this page and take a look at the Lua Scripting->Dump->Objective section and pick something meaningful from there (or just follow along), in this case I'll use "Objective.RequireRoom", you can take a look at the Rooms available to pick from in the Lua Scripting->Objects->Rooms section below, we'll do Solitary simply because it has no requirement itself (e.g be indoors) which is perfect for testing.

So after you set the parent, type in "Objective.RequireRoom ( "Solitary", true )", it should now look like this:

function CreateMyGrant()
	Objective.CreateGrant			( "Grant_MyGrant", 1337, 42 )
	
	Objective.CreateGrant			( "Grant_MyGrant_MyRequirement1", 0, 8001 )
	Objective.SetParent			( "Grant_MyGrant" )
	Objective.RequireRoom			( "Solitary", true )
end

Congratulations, you just made a basic grant, you can keep adding requirements, change the names, how much money you earn, etc. to your hearts content, save the file and run the game to test it out, if it doesn't work go back and compare it to my examples.


Adding your Grant to the Language File[edit]

Now that you've made your grant its time to give it a proper name and description, not to mention an explanation for its requirements.

First open the language folder in the data folder, then open english.txt and press CTRL + F or for mac Command + F, search for "objective_grant_bootstraps", which is the internal name of the Detention Center grant, to the right of it is the grants actual name "Contract: Basic Detention Center", the line below this is the grants description which appears below the grants name in the grant screen.

the next 6 lines are the internal names of the grants that have "objective_grant_boostraps" as its parent, in other words they are the requirements, the text to the right of those requirements is the text that appears in your grant checklist on the left-side of the screen to tell you what you need.

So now let's add proper names and descriptions for our grant, I'll be using the internal names of my grant guide above, replace them with whatever you've done yourself if you aren't following it.

Directly below "objective_grant_bootstraps_chef Hire at least two chefs" type a new blank line and then

"objective_Grant_MyGrant					Custom Grant"

which will be the grants name, on the next line we will place our description so type in

"objective_Grant_MyGrant_description		A custom grant designed to teach beginners"

now the only thing left is the description for the requirements, I recommend you keep it short and to the point due to the fact it is displayed constantly, so go to the next line and type

"objective_Grant_MyGrant_MyRequirement1 	Build 1 Solitary Room"

so it should now look like this:

objective_grant_bootstraps                  Contract: Basic Detention Centre
objective_grant_bootstraps_description      Turn an empty field into a functioning prison.  This government contract gives you the funds neccesary to build the absolute minimum facilities for your first set of Prisoners.
objective_grant_bootstraps_cells      Build enough cells for 8 prisoners
objective_grant_bootstraps_shower           Build a shower
objective_grant_bootstraps_yard             Build a yard 
objective_grant_bootstraps_kitchen          Build a kitchen
objective_grant_bootstraps_canteen          Build a canteen
objective_grant_bootstraps_guard            Hire at least two guards
objective_grant_bootstraps_chef             Hire at least two chefs

objective_Grant_MyGrant			Custom Grant
objective_Grant_MyGrant_description	A custom grant designed to teach beginners
objective_Grant_MyGrant_MyRequirement1 	Build 1 Solitary Room

and done! save the file, start the game and test it out, like always if it doesn't work go back and compare it to examples.

Data Folder[edit]

language[edit]

Within this folder you should include a .txt file named "base-language.txt".
This will allow for you to include the in-game text for names and tool-tips of objects, rooms, research, reform programs, materials, equipment and jobs.

All Var use lower case letters

Var Extentions Example Var Example Descriptive Text
material_MATERIALNAME None material_acid Acid
room_ROOMNAME None room_disco Disco
object_OBJECTNAME None object_car Car
Example Example Example Example
buildtoolbar_popup_EXTENTION_object/entity
  •  ?materials?
  •  ?rooms?
  • obj
  • staff
  •  ?Utilities?
buildtoolbar_popup_obj_car This car if not secure will be used as a get away vehical
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example

VEG MOD Example[edit]

If we use "Gary's amazing Vegetable Patch Mod" as an example:

var Objects Display Name
object_preparationtable Preparation Table
object_vegetableseeds Vegetable Seeds
object_rawpotato Potato
object_rawcabbage Cabbage
object_compost Compost
object_shed Shed
room_vegetablepatch Vegetable Patch
research_farming Farming
researchtooltip_farming Allows you to place a vegetable patch in your prison and train your prisoners to grow vegetables that can contribute to your kitchens ingredients pool.
reformprogram_horticulture Horticulture
material_farmland Compost
equipment_trowel Trowel
tooltip_seeds_compost Seeds need to be planted in Compost before they will grow and produce vegetables.
tooltip_seeds_needtending This plant needs to be tended before it will grow more vegetables.
job_custom_tendvegetables Tend Vegetables

Objects_Name is the name use to create each item within it valid .txt file i.e (object_rawpotato is templated in the material.txt file).

Objects Display Name is the name that will be displayed while playing Prison Architect.

scripts[edit]

jobs.txt[edit]

Here is where you will declare all the new Jobs.

VEG MOD Example[edit]

For example "Gary's amazing Vegetable Patch Mod" adds TendVegetables, to do this all we need to include is:

BEGIN Job
    Name                    TendVegetables
    JobTime                 30
    Tool                    Trowel
    Worker                  Prisoner
    Material                Compost
    Qualification           Horticulture
END
Var Description Example
Name Object name TendVegetables
JobTime Time in game minutes to complete job 30
Tool The required tool to complete the job Trowel
Worker Who can do this job
  • List
  • Prisoner
  • Gardener
Material Example Compost
Qualification Example Horticulture


This job can now be called in an objects script with Object.CreateJob("TendVegetables");

materials.txt[edit]

Here is where you will declare all your new Objects, Materials, Equipment and rooms.

VEG MOD Example[edit]

BEGIN Object     
    Name                 RawPotato
    Width                1  
    Height               1
    Toughness            1.0000  
    MaxStackSize         20
    RenderDepth          1  
    Properties           Material
    BEGIN   Sprite
        x 0 
        y 0  
        w 2  
        h 2  
        RotateType 0
    END
    BEGIN StackSprite
        x 4
        y 10
        w 2
        h 2
        RotateType 0
    END
END
Var Description Example
Name Objects Name Potatoes
Width x Tiles A Bed is 1 tile wide
Height Y Tiles A Bed is 2 tiles high
Toughness Example Float
MaxStackSize Example Example
RenderDepth Example Example
Properties Example Example

needs.txt[edit]

production.txt[edit]

This is where you will you add anything to do with moving or production in your mod.

VEG MOD Example 1, Production Rule[edit]

   BEGIN ProductionRule       
       Rule                 Storage
       Material             RawPotato  
       Container            PreparationTable
       Distribution         Random  
   END

Now, let's break this down.[edit]

Var Description Example
Rule What is happening to the material
  • Storage
  • Entity
  • None
Material The object you the production rule is about (In this case, what you are moving to storage) Any in-game or mod item
Container What to store the material in Any in-game or mod item
Distribution How to distribute the material
  • Random
  • Nearest

VEG MOD Example 2, Processor[edit]

   BEGIN Processor
       Processor           PreparationTable
       Input               RawPotato
       Output              Ingredients
       OperatingTime       15.0
       Properties          ShowDuringOperation
       Object              PreparationTable
       Worker              Cook
       Worker              Prisoner
       Qualification       KitchenInduction
   END

Now, let's break this down.[edit]

Var Description Example
Processor What the process is being done on Any in-game or mod item
Input The object that you use to start the process Any in-game or mod item
Output The object the input will turn into after the process is finished Any in-game or mod item
OperatingTime How long it will take to do (Measured in in-game minutes) 15.0
Properties  ?Unknown? ShowDuringOperation (Only option)
Object  ?Unknown? PreparationTable
Worker Who can perform this task
  • Cook
  • Prisoner
Qualification What program a prisoner will have to pass to do this process Any in-game or mod programs

reform_programs.txt[edit]

Here is where you will declare all the new reform_programs.

VEG MOD Example[edit]

For example "Gary's amazing Vegetable Patch Mod" adds Horticulture, to do this all we need to include is:

BEGIN Program
    Name            Horticulture
    SessionCost     -100
    Places          10
    SessionLength   120
    NumSessions     2
    Difficulty      10
    Research        PrisonLabour
    Room            VegetablePatch
    Teacher         Gardener
    Equipment       None
    Intake          Voluntary
    Properties      Practical    
END

research.txt[edit]

This is where you will declare all your new research options for your mod.

VEG MOD Example[edit]

For example "Gary's amazing Vegetable Patch Mod" adds Farming, to do this all we need to include is:

BEGIN Research   
    Name                 Farming  
    Type                 Ability  
    Requires             PrisonLabour  
    Admin                Maintainance  
    Cost                 -1500  
    Time                 360  
    X                    420  
    Y                    620 
END
Var Description Example
Name Name of your object, not to be confused with the display name of your object Farming
Type  ?Unknown?
  • Ability
  • Entity
  • None
Requires Needed Research
  • PrisonLabour
  • Warden
  • Armoury
  • Custom Research
Admin Staff member required to research

Limited to:

  • Warden
  • Maintainance
  • Finance
  • Security
Cost Funds spent to unlock -1500
Time Time taken to unlock in game-minutes 360
X X position on research board 420
Y Y position on research board 620

sprites.png[edit]

This is where you will you add the textures for everything in your mod.

Every sprite (graphic) you wish to use in your mod is put into this single file. Where this sprite is located in this file is declared in materials.txt.

VEG MOD Example[edit]

(This code is located in materials.txt and refers to sprites.png)

   BEGIN Object     
       Name                 RawPotato
       Width                1  
       Height               1
       Toughness            1.0000  
       MaxStackSize         20
       RenderDepth          1  
       Properties           Material
       BEGIN   Sprite
           x 0 
           y 0  
           w 2  
           h 2  
           RotateType 0
       END
   END

Now, let's break this down.[edit]

This is the part that says where the sprite is.

   BEGIN   Sprite
       x 0 
       y 0  
       w 2  
       h 2  
       RotateType 0
   END
Var Description Example
x The x coordinate of the left side of your sprite* 0
y The y coordinate of the top of your sprite* 0
w The width of your sprite (1 unit = 32 pixels [So 2 would = 64 pixels across]) 0
h The height of your sprite (1 unit = 32 pixels [So 2 would = 64 pixels across]) 0
RotateType How the object can be rotated
  • 0
  • 1
  • 2
  • 3
  • 4
*NOTE: Like the width and height the x/y coordinates take jumps of 32 pixels. 

E.g. If x = 1 in the code the sprite would be 32 pixels from the left. E.g. If y = 2 in the code the sprite would be 64 pixels down from the top.

Lua Scripting[edit]

Object[edit]

Rooms[edit]

None, Cell, HoldingCell, Canteen, Kitchen, Shower, Yard, Storage, Deliveries, Garbage, Execution, Workshop, Security, Office, MedicalWard, Morgue, CommonRoom, Laundry, CleaningCupboard, Visitation, Solitary, Armoury, Staffroom.

People[edit]

Builder, Policeman, SwatOfficer, Citizen, Doctor, Paramedic, Cook, Gardener, Janitor, Fireman, Avatar, Actor, Visitor, Mayor, Chief, Foreman, Psychologist, Accountant, Lawyer, Soldier .

Furniture[edit]

Bed, Toilet, Table, Chair, Bench, Bin, Sink, ServingTable, ShowerHead, Bookshelf, OfficeDesk, FilingCabinet, MedicalBed, MorgueSlab, WeightsBench, PhoneBooth, PoolTable, VisitorTable, IroningBoard, LaundryBasket

Doors[edit]

JailDoor, JailDoorLarge, Door, StaffDoor, SolitaryDoor, JailBars

Windows[edit]

Window, WindowLarge

Flora[edit]

Tree, GrassTurf

Electronics[edit]

ElectricChair, Light, Cooker, Fridge, MetalDetector, Tv, LargeTv, Cctv, CctvMonitor, LaundryMachine, WorkshopSaw, WorkShopPress

Utility[edit]

PowerStation, Capacitor, ElectricalCable , PowerSwitch, WaterPumpStation, PipeValve, PipeLarge, PipeSmall

Automobiles[edit]

SupplyTruck, FireEngine, RiotVan, Ambulance

Misc/Unknown[edit]

Sprinkler, Drain, None, Box, Stack, Fire, Garbage, Rubble, Equipment, Prop, Dummy, Polaroid, Brick, Concrete, Steel, Bleach, SheetMetal, LicensePlateBlank, LicensePlate, Ingredients, IngredientsCooking, IngredientsCooked, Meal, FoodTray, FoodTrayDirty, PrisonerUniform, DirtyPrisonerUniform, CrumpledPrisonerUniform, DismantleObject, DismantleUtility

Materials[edit]

Flooring[edit]

Dirt, PavingStone, Grass, Gravel, Road, RoadMarkings, RoadMarkingsLeft, RoadMarkingsRight, Stone, ConcreteTiles, ConcreteFloor, WoodenFloor, CeramicFloor, MosaicFloor, MetalFloor, MarbleTiles, WhiteTiles, FancyTiles, BurntFloor

Walls[edit]

Fence, ConcreteWall, BrickWall, BurntWall, PerimeterWall

Misc[edit]

None, Building, Demolish, DemolishWalls, Roof, BuildingFrame

Available Functions[edit]

The following is a list of available functions and their usages (where known). Note that some functions can only be used in Grants.lua, and some functions can only be used in a scenario's .lua file. For example Trigger.Create can only be used in scenario files, if you try to put it in Grants.lua the game will crash on load (or on mod enable).

Global[edit]

not including default Lua functions/tables

Global.Game					table
Global.ScriptSystem				userdata
Global.Objective				table
Global.Trigger					table

Objective[edit]

 Objective.Complete
 Objective.Create
	Usage: Objective.Create("Objective_Name")
	Creates an objective which is visible on the todo list.
 Objective.CreateGrant
	Usage: Objective.CreateGrant("Grant_Name", InitialMoney(number), CompletionMoney(number))
	Creates a grant.
 Objective.Exists
 Objective.Invert
 Objective.RequireBuilding
 Objective.RequireFlag
 Objective.RequireGangControl
 Objective.RequireMaterials
 Objective.RequireMaterialsAvailable
 Objective.RequireNamedObject
 Objective.RequireObjectOff
 Objective.RequireObjectOn
 Objective.RequireObjectPower
 Objective.RequireObjects
	Usage: Objective.RequireObjects("Object_Name", Amount<number>)
	Example: Objective.RequireObjects("Warden", 1)
	Example: Objective.RequireObjects("Bookshelf", 3)
	Example: Objective.RequireObjects("Prisoner", 20, "prisoner")
	Makes an objective or grant require that a number of a certain object has been installed, or a number of certain people have
been hired before the objective is complete. Objective.RequireObjectsInRoom Objective.RequirePowerCapacity Objective.RequirePrisonerInCell Objective.RequirePrisonersUnderControl Objective.RequireResearched Usage: Objective.RequireResearched("Research_Name") Example: Objective.RequireResearched("Finance") Objective.RequireRoom Usage: Objective.RequireRoom("Room_Name", true) Room_Name true = (probably) whether it is required, false may mean that it must not exist, i.e excluded. Objective.RequireRoomsAvailable Usage: Objective.RequireRoom("Room_Name", Quantity<number>) Objective.RequireSecurityInRoom Objective.SetFlags Objective.SetParent Usage: Objective.SetParent("Grant_Name") Sets a grant as a requirement for the parent grant to be completed. Objective.SetPayment Objective.TargetObject Objective.TargetRoom Objective.TargetZone

Game[edit]

Game Control

Game.Pause					function
	Usage: Game.Pause(3)
	Pauses the game for the set time period.
Game.SetMap					function
Game.SetChapter					function
Game.SetFlag					function
	Usage: Game.SetFlags( true, false )
Game.GetProperty				function
Game.GameOver					function
Game.SaveMap					function
Game.DebugOut					function

View

Game.CamZoom					function
	Usage: Game.CamZoom( 1.5, 10.0, false )
	Zooms the camera to the specified zoom level.
Game.CamMove					function
	Usage: Game.CamMove( 3, 32, 33, 50, 10, false )
	Moves the camera to the specified position.
Game.Show					function
	Usage: Game.Show( "Utilities" )
	Used to show particular building overlays.
Game.Hide					function
	Usage: Game.Hide( "Utliities" )
	Used to hide particular building overlays.
Game.CamMoveAndZoom				function
Game.FadeToColour				function
Game.FadeUp					function
Game.FadeToBlack				function

Polaroid

Game.Polaroid					function
Game.MovePolaroidTo				function
Game.HidePolaroid				function

Dialogues

Game.AdviserIncoming				function
	Usage: Game.AdviserIncoming( "Adviser_Name" )
	The portrait for the adviser with the name Adviser_Name will appear.
Game.AdviserSay					function
	Usage: Game.AdviserSay( "Adviser_Name", "Text_Name" )
	The text in the language file listed under Text_Name will be said by the adviser with the portrait that has the same name as the Adviser_Name
Game.AdviserSayBatch				function
	Usage: Game.AdviserSay( "Adviser_Name", "Text_Batch_Name" )
	The text in the language file in the group Text_Batch_Name will be said by the adviser with the portrait that has the same name as the Adviser_Name

Entity Control

Game.Damage					function
Game.SendEntityToObject				function
Game.SpawnPrisoners				function
Game.SendEntityToPos				function
Game.LoseEquipment				function
Game.Unlock					function
Game.Pickup					function
Game.SendEntityToRoom				function
Game.DropEquipment				function
Game.GiveEquipment				function
Game.Misconduct					function

Misc

Game.Drop					function
Game.PowerOff					function
	Usage: Game.PowerOff( "Object_Name" )
	Prevents the named object from drawing power (and stops it from working).
Game.PowerOn					function
	Usage: Game.PowerOn( "Object_Name" )
	Turns the named object back on, allowing it to draw power from the grid and work as normal.
Game.CamTrack					function
Game.Spawn					function
       Usage: Game.Spawn( "Object", "Object_Name", Xpos, Ypos )
Game.Delivery					function
Game.Sound					function
Game.StopSound					function
Game.HideArea					function
Game.SpawnDecal				        function
Game.SetSprite					function

Trigger[edit]

Trigger.PreserveObjectives			function
Trigger.Create					function
         Usage: Trigger.Create( "Function_Name" )
Trigger.RequireObjective			function
         Usage: trigger.RequireObjective( "Objective_Name" )
               "Objective_Name" is declared with Objective.Create()

Objects and their Properties[edit]

This section will cover the various properties that are available on objects

Name[edit]

The name that appears in the game for the object

Height[edit]

The height in squares that the object takes up

RoomSpecific[edit]

Defines that that the room defined in the "WorkGroup" property is the only rooms the object can be placed in (citation needed)

Width[edit]

The width in squares that the object takes up

WorkGroup[edit]

The room that the object can be placed in (citation needed)

Rooms and their Properties[edit]

This section will cover the various properties that are available on Rooms. Rooms are defined in the materials.txt file of a mod pack.

Name[edit]

The name that appears in the game for the Room

PrisonersCanWork[edit]

When set enables prisoners to work in the room.

Qualification[edit]

Defines the qualification needed by a prisoner for them to work in the room (citation needed)

Requirement[edit]

Requirements are a list of individual requirements

Example[edit]

   BEGIN Requirement Type Enclosed END
   BEGIN Requirement Type Object  Id VegetableSeeds  END
   BEGIN Requirement Type Object  Id LaundryBasket END
   BEGIN Requirement Type MinimumSize  x 5  y 5  END
   BEGIN Requirement Type Outdoor END

Enclosed[edit]

The "Enclosed" property when set defines that the room must be enclosed

MinimumSize[edit]

The "MinimumSize" states the size must be in squares width by height. Set using the x and y properties

Example[edit]

   BEGIN Requirement Type MinimumSize  x 5  y 5  END

Outdoor[edit]

The "Outdoor" property when set defines the room can be outdoors

Research[edit]

Defines the research that is required to obtain the room. (citation needed)