Modding Prison Architect

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

Moderator: NBJeff

elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Upcoming feature : Mod support

Postby elDiablo » Mon Jan 06, 2014 5:53 pm

You can mod the fornames.txt and surnames.txt files, which will modify the names of generated prisoners (that are newly joining a prison. I don't think it will modify those in a saved prison...), but not the Name in the Game tier prisoners (custom prisoners). People paid for their name to be in the game (think of it like a wall of backers in other games).

As xander said, you can replace the file directly, but changing the main.dat means you have to mess around with it each time there is an update. You can't use the A15+ modding system for changing some files. This list of files is very small, and only exists for good reasons (people paying for a certain thing in the game, mod type meta-data, etc.).
XiaNaphryz
level0
Posts: 7
Joined: Wed Apr 03, 2013 3:08 am

Re: Upcoming feature : Mod support

Postby XiaNaphryz » Mon Jan 06, 2014 5:56 pm

Got it, I'll just modify my local data file for now then. Thanks!
DoctorPelusa
level1
level1
Posts: 23
Joined: Sun Dec 29, 2013 12:47 am

Re: Upcoming feature : Mod support

Postby DoctorPelusa » Mon Jan 06, 2014 9:05 pm

I've tried to add an string for equipment_Iron by creating a translation file with a value for that but it doesn't seem to work as the game continues displaying equipment_Iron, am i doing something wrong or the game is unable to take my string for that equipment?
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Upcoming feature : Mod support

Postby elDiablo » Tue Jan 07, 2014 1:42 pm

You should be able to do that. Have you made the manifest file? And activated the mod in the game? If so, can you paste the language string from the file you made here for us?
DoctorPelusa
level1
level1
Posts: 23
Joined: Sun Dec 29, 2013 12:47 am

Re: Upcoming feature : Mod support

Postby DoctorPelusa » Tue Jan 07, 2014 2:17 pm

Firstly, i modified the contraband from laundry:

Code: Select all

BEGIN Room       
    Name                 Laundry
    Research             PrisonLabour
    BEGIN Requirement Type Indoor  END
    BEGIN Requirement Type Object  Id LaundryMachine  END
    BEGIN Requirement Type Object  Id LaundryBasket  END
    BEGIN Requirement Type Object  Id IroningBoard END
    BEGIN LikelyObject   Id      LaundryMachine   END
    BEGIN LikelyObject   Id      LaundryBasket   END
    BEGIN LikelyObject  Id      IroningBoard    END
    BEGIN LikelyObject   Id      Table         END
    BEGIN Contraband    Id      Poison  END
    BEGIN Contraband    Id      Iron  END
END


Then, i noticed that in the contraband screen the object appeared as "equipment_Iron" so i went to the language file and saw that that string wasn't defined, so i created a translation file on my mod only with a value for that string, but the game continues displaying "equipment_Iron":

Code: Select all

equipment_Iron                          Iron


Image
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Upcoming feature : Mod support

Postby elDiablo » Tue Jan 07, 2014 3:26 pm

Hey, I did a quick test. I made a mod with the following layout:

Code: Select all

│   manifest.txt

└───data
    │   materials.txt
    │
    └───language
            base-language.txt

materials.txt contained everything in the regular materials.txt, with your additions of contraband from the laundry.
base-language.txt is as follows:

Code: Select all

# =====================
# Test string
# =====================

equipment_Iron                     Iron


I activated the mod in game, and restarted Prison Architect (I think the materials.txt is only loaded at game load at the moment, I will check and fix this if it is the case). Loaded a prison with a laundry, showed the contraband, and Iron is shown for the laundry.
DoctorPelusa
level1
level1
Posts: 23
Joined: Sun Dec 29, 2013 12:47 am

Re: Upcoming feature : Mod support

Postby DoctorPelusa » Tue Jan 07, 2014 4:59 pm

What program did you used to create the lenguage file? I think i'm having some problem about editing it with the notepad, as i'm following your layout and not reaching to get it translated, the game recognizes the mod as including a translation thought.

I will send you my folder by PM in a moment.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Upcoming feature : Mod support

Postby xander » Wed Jan 08, 2014 12:51 am

One possible thought (I haven't experimented with it myself), but how are you using whitespace? I recall the the strings files for Darwinia required a blank line at the end of the file. If the last line was not blank, then it was ignored. Maybe the issue with your mod is as simple as that? Or perhaps there is too much / too little whitespace between the tag and the string? Or the wrong kind of whitespace (spaces vs tabs)? Or the wrong newline char at the end of the line (/n vs /r, for instance)?

xander
DoctorPelusa
level1
level1
Posts: 23
Joined: Sun Dec 29, 2013 12:47 am

Re: Upcoming feature : Mod support

Postby DoctorPelusa » Wed Jan 08, 2014 1:09 am

xander wrote:One possible thought (I haven't experimented with it myself), but how are you using whitespace? I recall the the strings files for Darwinia required a blank line at the end of the file. If the last line was not blank, then it was ignored. Maybe the issue with your mod is as simple as that? Or perhaps there is too much / too little whitespace between the tag and the string? Or the wrong kind of whitespace (spaces vs tabs)? Or the wrong newline char at the end of the line (/n vs /r, for instance)?

xander


Eldiablo solved it by PM a couple of hours ago, but that was it, translation files require a like break at the end. Ty.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Upcoming feature : Mod support

Postby xander » Wed Jan 08, 2014 4:08 am

DoctorPelusa wrote:
xander wrote:One possible thought (I haven't experimented with it myself), but how are you using whitespace? I recall the the strings files for Darwinia required a blank line at the end of the file. If the last line was not blank, then it was ignored. Maybe the issue with your mod is as simple as that? Or perhaps there is too much / too little whitespace between the tag and the string? Or the wrong kind of whitespace (spaces vs tabs)? Or the wrong newline char at the end of the line (/n vs /r, for instance)?

xander


Eldiablo solved it by PM a couple of hours ago, but that was it, translation files require a like break at the end. Ty.

Whee! For a total shot in the dark, I did pretty good... ;)

xander
DoctorPelusa
level1
level1
Posts: 23
Joined: Sun Dec 29, 2013 12:47 am

Re: Upcoming feature : Mod support

Postby DoctorPelusa » Wed Jan 08, 2014 10:17 pm

I've been trying to fulfill a commonly requested feature and give transparency to the fences, but, for some reason the transparent part appears as black ingame, i'm confused since tunnels and stones have transparent parts, anyone has an insight on this?
UberFuber
level1
level1
Posts: 42
Joined: Thu Jan 02, 2014 5:16 pm

Re: Upcoming feature : Mod support

Postby UberFuber » Wed Jan 15, 2014 7:20 pm

Is it possible to have a Grant show up repeatedly?
Basically, once a grant is completed, it shows up in the Grant selection list and can be taken again.
I'm trying to mod in three Grants that allow you to bring in some number of Max, Medium, Min security prisoners everytime to take a Grant (perhaps with a negative "award". Basically, you pay to have more prisoner brought into your prison).

I have some suspicion that I could accomplish with Trigger and CreateGrant (have the trigger fire on the previous grant being completed to create the same grant again). But I'm not sure and can't try it out right this moment.

Also, is my suspicion that Game.Delivery("truck",8,"Prisoner") bring in 8 prisoners on the delivery truck correct?

To be more general, is there an API documentation on what LUA functions we have available?

EDIT: Just tried it, seems like having Trigger in grant.lua crashes the game.
I was trying to do this.

Code: Select all

function CreateBringPrisoner()
   Objective.CreateGrant         ( "Grant_more_prisoners", 0, 0 )
   
   Objective.CreateGrant         ( "Grant_have_lawyer", 0, 0 )
   Objective.SetParent            ( "Grant_more_prisoners" )
   Objective.RequireObjects      ( "Warden", 1 )
   
   Trigger.Create            ( "CreateBringPrisoner_SendMore" )
   Trigger.RequireObjective      ( "Grant_more_prisoners" )
end

function CreateBringPrisoner_SendMore()
   Game.Delivery    ( "Prisoner", 8, "Prisoner" )
   -- Recreate the grant
   -- CreateBringPrisoner()
end

Basically, I'm trying to have the completion of the grant triggers delivery of 8 prisoners. Adding Trigger.Create crashes it.
jackbua
level1
level1
Posts: 26
Joined: Sun Feb 02, 2014 7:52 am

Re: Upcoming feature : Mod support

Postby jackbua » Fri Feb 07, 2014 4:54 am

elDiablo wrote:Yeah, at the moment you can't override the initial grants. That's how we've designed the system. In the next version, we will make it so that you can, by just naming your grant the same as the initial grants.

As for the tooltip, that is weird, and we'll have a look.



Has this feature been implemented yet?
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Upcoming feature : Mod support

Postby elDiablo » Fri Feb 07, 2014 8:13 am

Yep, just call any grants you want to override the same as the base ones, and the first mod to load will override it.
User avatar
snickerzz
level0
Posts: 4
Joined: Fri Dec 27, 2013 8:47 pm

Re: Upcoming feature : Mod support

Postby snickerzz » Sat Feb 08, 2014 12:15 pm

jois13 wrote:
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.


Are you a fucking retard?

Are YOU a fucking retard!! PA does or is very closes to mine crafts mod support AND ITS ONLY ONE YR OLD
Joe

Actually, the games been in development since 2010... and i agree with fundevin, minecraft doesn't have mod support at all natively. all mods are hacked into the game. With your mindset, you could say GTA IV has mod support, when it really doesn't at all.

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 3 guests