Modding Prison Architect

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

Moderator: NBJeff

User avatar
Smodd
level1
level1
Posts: 69
Joined: Mon Oct 08, 2012 3:22 pm

Re: Upcoming feature : Mod support

Postby Smodd » Sun Dec 08, 2013 8:21 pm

Roomon1 wrote:I suspect you're looking for the Objective calls, as seen here:

Code: Select all

   Objective.Create            ( "DeathRow_BuildOuterDoor" )
   Objective.TargetZone         ( 19, 47, 20, 47 )
   Objective.RequireObjects      ( "JailDoorLarge", 1 )

It looks to me like the game knows how to build various objects. This means that by calling Objective.RequireObjects with the objects you want, the game will automatically make the proper buttons flash.
Does that do the trick?
-Roomon1


Nope it doesn't do the trick.
First line: Creates the objective called DeathRow_Build_OuterDoor which you can name in the base-language.txt under the string objective_DeathRow_Build_OuterDoor
Second line: Creates a glowing targetzone on the Map between the coordinates 19/47 and 20/47
Third line: Shows the game that one large jaildoor is needed in the targetzone. Also it let the string "JailDoorLarge" appear in the zone
Roomon1
level0
Posts: 3
Joined: Sun Dec 16, 2012 7:14 pm

Re: Upcoming feature : Mod support

Postby Roomon1 » Mon Dec 09, 2013 3:09 am

Smodd wrote:Nope it doesn't do the trick.

Really? That's curious, since it seems to do the trick for me. Here's what I've done. Hopefully you'll find the difference between that and what you're doing.

First, I added a new objective to function DeathRow_Intro():

Code: Select all

    -- Roomon1: Removed unmodified starting code for brevity

        -- Build jail door entrance

    Game.AdviserSay         ( "Ceo", "adviser_deathrow_buildinside1" )
    Game.AdviserSay         ( "Ceo", "adviser_deathrow_buildinside2" )

    Objective.Create         ( "DeathRow_BuildOuterDoor" )
    Objective.TargetZone     ( 19, 47, 20, 47 )
    Objective.RequireObjects ( "JailDoorLarge", 1 )

    -- Roomon1: Added this line and the next 3
    Objective.Create             ( "DeathRow_BuildExtraDoor" )
    Objective.TargetZone         ( 19, 49, 19, 49 )
    Objective.RequireObjects     ( "JailDoor", 1 )

    Trigger.Create          ( "DeathRow_BuildInternalWalls" );
    Trigger.RequireObjective( "DeathRow_Building" )
    Trigger.RequireObjective( "DeathRow_BuildOuterDoor" )
    -- Roomon1: Added this line and the following one
    Trigger.RequireObjective( "DeathRow_BuildExtraDoor" )

    -- Roomon1: Removed unmodified ending code for brevity

Those changes ad a zone that needs a Jail Door just below the main building, as shown in this clipped screenshot: Image (http://imgur.com/8sOE0FD).

It also caused the Jail Door button to flash, as shown in this other clipped screenshot: Image (http://imgur.com/mqojCto]).


It also added the door to the objectives listed, though I should note that the objective list did not show reasonable text. Instead, it showed "objective_DeathRow_BuildExtraDoor". I believe that fixing this would require adding a string to the language file, though I have yet to test that. I would expect placing a line like this in the language/base-language.txt file (or the one for your mod) to do the trick:

Code: Select all

objective_deathrow_buildextradoor   Build an extra, useless Jail Door
User avatar
Smodd
level1
level1
Posts: 69
Joined: Mon Oct 08, 2012 3:22 pm

Re: Upcoming feature : Mod support

Postby Smodd » Sat Dec 14, 2013 1:40 pm

Sorry I was away for some days, but anyway it doesn't work for me. I don't find a mistake in my code?! Perhaps you do...

Code: Select all

function PATC01_staffroom()
   
   Game.CamMove               ( 13, 2, 44, 21, 2, true )
   Game.AdviserSay               ( "Warden", "PATC01_warden_staffroom_01" )
   Game.AdviserSay               ( "Warden", "PATC01_warden_staffroom_02" )
   
   Objective.Create            ( "PATC01_staffroom_foundations" )
   Objective.TargetZone         ( 23, 2, 33, 8 )
   Objective.RequireBuilding      ( false )
   
   Objective.Create            ( "PATC01_staffroom_staffdoor" )
   Objective.TargetZone         ( 28, 8, 28, 8 )
   Objective.RequireObjects      ( "StaffDoor", 1 )
   
   Trigger.Create               ( "PATC01_staffroom_walls" )
   Trigger.RequireObjective      ( "PATC01_staffroom_foundations" )
   Trigger.RequireObjective      ( "PATC01_staffroom_staffdoor" )
   
end
mschol
level0
Posts: 2
Joined: Tue Jun 04, 2013 10:49 am

Re: Upcoming feature : Mod support

Postby mschol » Mon Dec 16, 2013 10:36 am

is it possible to add a new menu item (for example a new room) with the current modding system?
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Upcoming feature : Mod support

Postby elDiablo » Mon Dec 16, 2013 10:58 am

What do you mean "a new menu item"? In the main menu, not really... While the layouts of the main menus are data driven, the functionality is not. In game... not really either (for the same reason). You might be able to add items into the construction menus, but I doubt it would work...
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Upcoming feature : Mod support

Postby elDiablo » Mon Dec 16, 2013 2:53 pm

Just so everyone else knows, it isn't currently possible to highlight items in the build menu with the scripting system. I will look into adding this.

Cheers
elDiablo

Smodd wrote:Well if you want to support mods i've got a very very basic request:

Please give a introduktion (for example a .pdf) for the strings/commands programmed in in LUA. I looked up all of the .lua files I could find and got a lot of those things worked out... but to work out every single command is more than nervewrecking! If I'm thinking about "Game.CamMove ( A, B, C, D, E, true/false)" I could become a lunatic 'cause this bloddy thing is zooming crazily illogical for me. :evil:

Also what I searched for over an hour:

In "Deathrow" you have to place a foundation and a jaildoor. After the CEO stoped talking the buttons for "Foundations" and "Objects" as well as the "Large Jail Door" is flashing. Where the hell is this in the code? I can't find it

Code: Select all

function DeathRow_Intro()
Game.AdviserIncoming   ("Ceo")
Game.CamMove         ( 48, 15, 85, 38, 0, true )
Game.CamMove         ( 48, 24, 85, 46, 30, false )
Game.AdviserSayBatch    ( "Ceo", "adviser_deathrowintro" )
Game.CamMove            ( 0, 31, 41, 57, 5, true )
Game.AdviserSay         ( "Ceo", "adviser_deathrowintrob_1" )
Game.AdviserSay         ( "Ceo", "adviser_deathrowintrob_2" )
Objective.Create            ( "DeathRow_Building" )
Objective.TargetZone         ( 12, 34, 23, 47 )
Objective.RequireBuilding      ( false )
Game.AdviserSay               ( "Ceo", "adviser_deathrowintrob_3" )
Game.AdviserSay         ( "Ceo", "adviser_deathrow_buildinside1" )
Game.AdviserSay         ( "Ceo", "adviser_deathrow_buildinside2" )
Objective.Create            ( "DeathRow_BuildOuterDoor" )
Objective.TargetZone         ( 19, 47, 20, 47 )
Objective.RequireObjects      ( "JailDoorLarge", 1 )
Trigger.Create         ( "DeathRow_BuildInternalWalls" );
Trigger.RequireObjective( "DeathRow_Building" )
Trigger.RequireObjective( "DeathRow_BuildOuterDoor" )
Objective.Create            ( "DeathRowy_BuildFoundations" )
Objective.TargetZone         ( 22, 46, 23, 47 )
Objective.RequireBuilding      ( true )
Objective.SetFlags            ( false, true )
Trigger.Create               ( "DeathRow_ExplainFoundations" )
Trigger.RequireObjective      ( "DeathRow_BuildFoundations" )
end



Please let there be a small guide on an pdf or something like this!
User avatar
Smodd
level1
level1
Posts: 69
Joined: Mon Oct 08, 2012 3:22 pm

Re: Upcoming feature : Mod support

Postby Smodd » Tue Dec 17, 2013 6:23 pm

It is somehow possible to lock some Systems or Objects/Menu Points?
mschol
level0
Posts: 2
Joined: Tue Jun 04, 2013 10:49 am

Re: Upcoming feature : Mod support

Postby mschol » Wed Dec 18, 2013 1:45 am

elDiablo wrote:What do you mean "a new menu item"? In the main menu, not really... While the layouts of the main menus are data driven, the functionality is not. In game... not really either (for the same reason). You might be able to add items into the construction menus, but I doubt it would work...

i meant adding an item to, for example, the rooms construction menu, (for, obviously, adding a new room)

adding an button seems possible in the code, but the function it should call seems to be locked away in the binary, and that makes it probably impossible for the time being (who knows what the future will bring :D)
User avatar
Meeeps
level3
level3
Posts: 352
Joined: Thu Oct 10, 2013 2:28 pm

Re: Upcoming feature : Mod support

Postby Meeeps » Wed Dec 18, 2013 1:30 pm

Hello, sorry for crossposing, but since this thread got the most attention by modder or mod devs, I try to clarify the legal issue here: viewtopic.php?f=43&t=46456, so my pending qustion is how do you inform IV about mods?
User avatar
Smodd
level1
level1
Posts: 69
Joined: Mon Oct 08, 2012 3:22 pm

Re: Upcoming feature : Mod support

Postby Smodd » Thu Dec 19, 2013 6:09 pm

Why do you want to inform them about mods?

2. Restrictions.
You are not entitled to and must not:
[...]
create data or executable programs which mimic data or functionality in the Game except in the case of Permitted Modding;


If they implement Mod Support, why should it be not permitted?^^


EDIT: Oh sorry I missunderstood you. You meant the "Permitted Modding" to monetise something... well I wouldn't do that, but good luck^^
User avatar
Meeeps
level3
level3
Posts: 352
Joined: Thu Oct 10, 2013 2:28 pm

Re: Upcoming feature : Mod support

Postby Meeeps » Thu Dec 19, 2013 11:30 pm

No, I meant this:
The Prison Architect End User License Agreement wrote:If you want to make your Mods available to the Game community please let INTROVERSION know. Any Mods you create from scratch belong to you but any Mods that use INTROVERSION code or assets will belong to INTROVERSION


Edit: It is mainly about distributing...
(There is rarely any mod which does not belong to this category.)
User avatar
Smodd
level1
level1
Posts: 69
Joined: Mon Oct 08, 2012 3:22 pm

Re: Upcoming feature : Mod support

Postby Smodd » Fri Dec 27, 2013 6:46 pm

Guys are you serious? You deleted all of my local files, after I uploaded it? :shock: Also the Upload seems to have only uploaded the folders and no data... so my data is gone and on Steam is nothing? :evil:
MiriW
level2
level2
Posts: 94
Joined: Fri Nov 29, 2013 5:29 pm

Re: Upcoming feature : Mod support

Postby MiriW » Fri Dec 27, 2013 6:49 pm

Yeah, it didnt really work for me either, but thankfully I had an extra elsewhere :s
User avatar
Smodd
level1
level1
Posts: 69
Joined: Mon Oct 08, 2012 3:22 pm

Re: Upcoming feature : Mod support

Postby Smodd » Fri Dec 27, 2013 6:52 pm

Well I have also a backup, but not from the last version, but this is (sorry) bullshit!
Master-Guy
level2
level2
Posts: 125
Joined: Sat Jan 12, 2013 1:55 pm

Re: Upcoming feature : Mod support

Postby Master-Guy » Fri Dec 27, 2013 6:55 pm

Didn't you upload it somewhere? You can try downloading it from there again.
As far as I see my upload went without any problems, but when selecting it in the workshop, it does not download :S

Edit: Just saw that the item on the Steam workshop is only 42kb, while the directory of my translation is 7mb..
Last edited by Master-Guy on Fri Dec 27, 2013 6:57 pm, edited 1 time in total.

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 1 guest