Modding Prison Architect

(previously 'DEVELOPER') Private forum for registered community members. To register, please visit www.prison-architect.com/register.

Moderator: NBJeff

User avatar
Chris
Introversion Staff
Introversion Staff
Posts: 1172
Joined: Sat Nov 25, 2000 7:28 pm
Location: Cambridge, UK
Contact:

Modding Prison Architect

Postby Chris » Thu Nov 21, 2013 4:03 pm

Hey everyone,

We are hard at work on a new system to better support mods to the game, due for release in an upcoming Alpha. Mods will be stored in the users savefolder/mods/, and users will be able to activate and deactivate mods from an in-game window. You will be able to run multiple mods simultaneously, eg a translation to German, a new sprite bank and a new Grants mod could all be run at once with this new system.

There are a few steps to follow to prepare existing mods for our new system. Broadly speaking we have kept things the same - you simply override the files in /data/ that you want to mod, but you should now include a manifest.txt and a thumbnail image to go with your mod. Here are some instructions on how to make your mod compatible with the new official Prison Architect modding system.

- All mods are held in the /mods/ subfolder within the PA save data folder
- Each mod has its own subdirectory, with the folder layout shown:

mods
├───YourMod/
│ │ manifest.txt
│ │ thumbnail.png
│ ├───data
│ │ ...

- These mod folders need to contain a data folder and a manifest.txt file, as well as an optional thumbnail.png.
- The thumbnail is shown in the mods menu when the mod is selected
- The data folder mirrors the structure of the main.dat's data directory, allowing you to override any game files with your own
- The manifest.txt file contains a list of items which describe the mod to the system in the following format:

Code: Select all

Name                "Mod Name"
Author               "Mod Author"
Description        "Mod Description"
Version             "v1.0"
Date                 "DD/MM/YYYY"
URL                 "http://www.yourwebsite/my-pa-mod/"


Language translations
- The core language file is now located at /data/language/base-language.txt, and can be overridden by your mod
- Language is loaded "additively", meaning the base language is loaded first, then any language files from the mods are loaded in order, overriding strings as they are found. So translations to other languages are easy - include each string translation in your own base-language.txt file.
- If you are providing new strings for your mod, eg for a new Grants mod, you only need to include your new strings in your base-language.txt. Ie you no longer need to duplicate the rest of the strings file. Your new strings will be loaded alongside the base english language.

New grants mods
The grants.lua file is also loaded additively. This means that different grants mods can work together. Within your grants.lua file, you now no longer need to include our base grants, only your own. Each grants mod is loaded (in order), and then the CreateGrants() function is called. Each grants mod can also provide their own base-language.txt file with only the phrases that they require (as the language files are also loaded additively). This means you don't have to copy our grants and strings into your mod.
Last edited by RGeezy911 on Wed Jun 25, 2014 1:10 am, edited 1 time in total.
Reason: Making topic title more relevant.
thekillergreece
level4
level4
Posts: 876
Joined: Wed Jun 12, 2013 1:31 pm
Location: Ammm...Greece maybe?

Re: Upcoming feature : Mod support

Postby thekillergreece » Thu Nov 21, 2013 5:00 pm

Wha..But...Can modders be able to make their own system, missions? Such like, on a mission, you are armed with 3 riot guards and must stop rioting prisoners.

On systems, you should be able to make your own situation such as, Hostage situation(I dont know if you, Mr. Chris will add it) or even add ability to make your OWN feature such like Multi-Floors, armed guards, etc.

Can it happen?Or even change the colour of guards...
User avatar
fundevin
level0
Posts: 4
Joined: Fri Nov 08, 2013 7:20 am

Re: Upcoming feature : Mod support

Postby fundevin » Thu Nov 21, 2013 5:10 pm

I find it funny how Chris has already made more mod support than minecraft has...

Anyway, awesome job Chris :D. Not a modder but seems awesome from a player point of view.
RGeezy911
level5
level5
Posts: 1098
Joined: Fri Aug 09, 2013 7:21 pm

Re: Upcoming feature : Mod support

Postby RGeezy911 » Thu Nov 21, 2013 7:08 pm

Nice! I always like it when a game allows for / makes it easier for modders to alter the game in fun creative ways.
iScripters
level2
level2
Posts: 205
Joined: Sat Jun 01, 2013 12:36 pm

Re: Upcoming feature : Mod support

Postby iScripters » Sat Nov 23, 2013 12:01 pm

Awesome stuff Chris! Too bad I suck at art stuff, but I had a great idea for a mod... not yet telling because I might try it anyway :)
User avatar
christopher1006
level5
level5
Posts: 1019
Joined: Sat Jul 28, 2012 9:01 pm

Re: Upcoming feature : Mod support

Postby christopher1006 » Sun Nov 24, 2013 1:13 am

I might have to try my hand at modding with this. Seems as good a game as any to learn how to use LUA.
User avatar
AppealPlay
level1
level1
Posts: 10
Joined: Wed Nov 14, 2012 7:56 am

Re: Upcoming feature : Mod support

Postby AppealPlay » Sun Nov 24, 2013 9:12 am

totte1015 wrote:
fundevin wrote:I find it funny how Chris has already made more mod support than minecraft has...

Anyway, awesome job Chris :D. Not a modder but seems awesome from a player point of view.


<Quoted post was removed>


He's right, you know. Minecraft modding is sketchy at best.

Really glad to see support for modding coming! :)
TheEisbaer
level1
level1
Posts: 53
Joined: Wed Dec 19, 2012 6:26 pm
Location: Germany
Contact:

Re: Upcoming feature : Mod support

Postby TheEisbaer » Sun Nov 24, 2013 11:21 am

Sooo do translations support characters like "ü,ö,ä" then?
User avatar
111none
level4
level4
Posts: 970
Joined: Fri Oct 19, 2012 3:32 am
Location: Wangjing, Beijing, Peoples Republic of China

Re: Upcoming feature : Mod support

Postby 111none » Sun Nov 24, 2013 2:24 pm

TheEisbaer wrote:Sooo do translations support characters like "ü,ö,ä" then?

They are not supported, yet.
Chris I will hunt you down if you don't support Chinese and non english Charters.
Only joking.
smallsnail
level0
Posts: 7
Joined: Fri Jun 07, 2013 4:43 am
Location: Ulsan, South Korea

Re: Upcoming feature : Mod support

Postby smallsnail » Fri Nov 29, 2013 4:06 pm

Yay~ It is Nice!

But Translation isn't Complished. for example, My Mother Language is Korean(also Not Support PA's Font). So I wrote translation file, it view ?? ??. I wish PA Support Unicode Support

Maybe it's so Hard, But Please :)
Nielsm
level0
Posts: 1
Joined: Fri Nov 29, 2013 7:58 pm

Re: Upcoming feature : Mod support

Postby Nielsm » Fri Nov 29, 2013 9:19 pm

Will modding appear in the steam workshop?

Can't wait for all the random mods that are going to appear in there :)
ascdren
level1
level1
Posts: 19
Joined: Sun Oct 21, 2012 6:11 pm

Re: Upcoming feature : Mod support

Postby ascdren » Sat Nov 30, 2013 5:47 am

Nielsm wrote:Will modding appear in the steam workshop?

Can't wait for all the random mods that are going to appear in there :)



not sure if they'll put it on stream worksho

but if you want to add mods on steam it's exactly the same as doing it with the game installed directly (just done it playing around with the scenario mod they put together)

the directery should be something like

Code: Select all

C:\Users\<USERNAME>\AppData\Local\Introversion\Prison Architect\mods


where <USERNAME> is whatever your username is on the computer, It may alo be called 'public'

(it is NOT in the games steam folder though so i suggest using the method i mention below to find it)


if you are having trouble finding the mods folder just click this button

Image
ascdren
level1
level1
Posts: 19
Joined: Sun Oct 21, 2012 6:11 pm

Re: Upcoming feature : Mod support

Postby ascdren » Sat Nov 30, 2013 6:17 am

111none wrote:
TheEisbaer wrote:Sooo do translations support characters like "ü,ö,ä" then?

They are not supported, yet.
Chris I will hunt you down if you don't support Chinese and non english Charters.
Only joking.


it seems that the three examples you provided are supported but it doesn't appear to support non western characters.

It seems the game uses a sprite sheet to create some of the text (haven't looked into the code behind it yet so not sure how much of the text)

sprite sheets

so creating a new sprite sheet and directing it there might help with some of the text, the rest I don't know if it would be possible but worse case scenario would be hacking in some code to get it to direct all text output to the new sprite sheet (may dramatically reduce performance though)


not sure how hard the worst case scenario is as I'm not an expert with coding and can just about hack together some simple mods




EDIt: just to clarify only the text created from the sprite sheets allows 'special'[1] characters



[1] 'special' Refer to character that do not appear on a standard English keyboard and may or maynot be a technical term and is simply how i've come to know them
User avatar
paktsardines
level5
level5
Posts: 1752
Joined: Mon Oct 01, 2012 11:10 am
Location: Australia

Re: Upcoming feature : Mod support

Postby paktsardines » Sun Dec 01, 2013 11:44 am

The grants.lua file is also loaded additively. This means that different grants mods can work together. Within your grants.lua file, you now no longer need to include our base grants, only your own. Each grants mod is loaded (in order), and then the CreateGrants() function is called.


Oh dear, I'm quietly trying not to panic...
Does this mean we can no longer remove or modify the base grants in our mods? The GFC mod relies heavily on changes made to the initial base grants (for example, requiring an accountant and removing up-front payments etc).

I was just testing prior to posting the latest GFC mod update and discovered the initial grants are now listed twice (the original grants plus my modified versions of same). I can only remove my modified grants, leaving the original ones which I find too generous.

Has anyone had success removing, modifying or overriding the base grants in their mod? If so, any tips?


Cheers heaps.
User avatar
Meeeps
level3
level3
Posts: 352
Joined: Thu Oct 10, 2013 2:28 pm

Re: Upcoming feature : Mod support

Postby Meeeps » Sun Dec 01, 2013 3:17 pm

Is it possible to get the mods loaded while the game is running in "safe mode"?

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 7 guests