Page 1 of 9

Modding Prison Architect

Posted: Thu Nov 21, 2013 4:03 pm
by Chris
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.

Re: Upcoming feature : Mod support

Posted: Thu Nov 21, 2013 5:00 pm
by thekillergreece
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...

Re: Upcoming feature : Mod support

Posted: Thu Nov 21, 2013 5:10 pm
by fundevin
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.

Re: Upcoming feature : Mod support

Posted: Thu Nov 21, 2013 7:08 pm
by RGeezy911
Nice! I always like it when a game allows for / makes it easier for modders to alter the game in fun creative ways.

Re: Upcoming feature : Mod support

Posted: Sat Nov 23, 2013 12:01 pm
by iScripters
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 :)

Re: Upcoming feature : Mod support

Posted: Sun Nov 24, 2013 1:13 am
by christopher1006
I might have to try my hand at modding with this. Seems as good a game as any to learn how to use LUA.

Re: Upcoming feature : Mod support

Posted: Sun Nov 24, 2013 9:12 am
by AppealPlay
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! :)

Re: Upcoming feature : Mod support

Posted: Sun Nov 24, 2013 11:21 am
by TheEisbaer
Sooo do translations support characters like "ü,ö,ä" then?

Re: Upcoming feature : Mod support

Posted: Sun Nov 24, 2013 2:24 pm
by 111none
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.

Re: Upcoming feature : Mod support

Posted: Fri Nov 29, 2013 4:06 pm
by smallsnail
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 :)

Re: Upcoming feature : Mod support

Posted: Fri Nov 29, 2013 9:19 pm
by Nielsm
Will modding appear in the steam workshop?

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

Re: Upcoming feature : Mod support

Posted: Sat Nov 30, 2013 5:47 am
by ascdren
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

Re: Upcoming feature : Mod support

Posted: Sat Nov 30, 2013 6:17 am
by ascdren
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

Re: Upcoming feature : Mod support

Posted: Sun Dec 01, 2013 11:44 am
by paktsardines
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.

Re: Upcoming feature : Mod support

Posted: Sun Dec 01, 2013 3:17 pm
by Meeeps
Is it possible to get the mods loaded while the game is running in "safe mode"?