Modding API

Discussion about Mods for Prison Architect

Moderator: NBJeff

meowxiik
level0
Posts: 2
Joined: Wed Jul 15, 2015 4:16 pm

Modding API

Postby meowxiik » Wed Jul 15, 2015 4:38 pm

As far as I know the modding in Prison Architect can be only done in LUA. Which is really pain in the ass sometimes. And there even isn't any documentation! Do you think you could do something like modding API for PA? In Java or C++ or C# or IDontKnowInWhatLanguageIsThisGameWritten? Just PLEASE!

P.S.: what should the API do:
-Control camera
-Control all windows, creating whole new ones
-Control every single block every single wire on map
-Control individually every prisoner or guard or employee
-Controling time (no idea what to do with this one, maybe some auto-time pausing when something critical happens)
-Add rooms, their functionalities (something like myRoom.setJob(...))
-Creating new blocks, new walls.
-Creating new functional blocks, new weapons and items

P.P.S.: My ideas
-Play as prisoner
-Play as prisoner in someone elses prison (-> prisoner - client, prison - server)
-Automatic bug fixing(Just when some bug is known the game should do some steps to delete the bug after it happens, example: When there are some stuck doctors due to some dead bodies showing "TODO: Heal prisoner" the mod would remove all dead prisoners causing doctors to be free again)
-Some new jobs for prisoners

P.P.P.S: If you could do the modding API in holiday, I would definitly start creating some mods! (It's not like when not in holiday I wouldn't.. I would.. just not that much)
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Modding API

Postby aubergine18 » Wed Jul 15, 2015 5:19 pm

I'm working on a guide which will document some of the stuff (mainly scripting related to objects defined in materials.txt). Hope to have initial version of it published later this week.

Some of the stuff you want can already be done, for example you can spawn objects, delete objects, etc. It's also possible to control prisoners to some extent, eg. clearing or setting their paths, making them carry things, etc. And you can set jobs (at least on objects, not tried on rooms yet).

I'd suggest start by looking at the dev wiki which has some basic informations:

http://devwiki.introversion.co.uk/pa/index.php/Modding

http://devwiki.introversion.co.uk/pa/in ... tart_Guide

http://devwiki.introversion.co.uk/pa/in ... _Explained

http://devwiki.introversion.co.uk/pa/in ... /ModSchema

viewtopic.php?t=17664

http://devwiki.introversion.co.uk/pa/index.php/Lua

And also start downloading mods from the Steam Workshop, there are about 100 worthy mods that you can inspect to see how they achieve certain things.
meowxiik
level0
Posts: 2
Joined: Wed Jul 15, 2015 4:16 pm

Re: Modding API

Postby meowxiik » Wed Jul 15, 2015 7:08 pm

Your guide will be certainly helpful, but there are two things that are not possible and critical for my multiplayer project (if some will be)
-FULL and ABSOLUTE control of prisoners and guards
-creating new text messages, windows (as inventory for instance)
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Modding API

Postby aubergine18 » Wed Jul 15, 2015 11:20 pm

The guide is now posted (first version of it anyway, still much more to add):

http://steamcommunity.com/sharedfiles/f ... =480978426

I doubt you'll be able to implement multiplayer because currently it's not possible to use the require() function in Lua - so you can't get access to network etc.

Outside of campaign mode I don't think there's any way to create new windows or messages to the user. In normal game mode the required functions don't exist in the Game library.
iScripters
level2
level2
Posts: 205
Joined: Sat Jun 01, 2013 12:36 pm

Re: Modding API

Postby iScripters » Mon Aug 03, 2015 3:35 pm

Not even going to touch modding until it supports Python. Other languages are okay too, but I'm not coming anywhere near Lua. Ugliest language ever.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Modding API

Postby xander » Mon Aug 03, 2015 4:46 pm

iScripters wrote:Not even going to touch modding until it supports Python. Other languages are okay too, but I'm not coming anywhere near Lua. Ugliest language ever.

That's nice, dear. I am sure that we are all missing out on the amazing mods that you would have created, had Prison Architect supported a scripting language that is more to your liking.

xander
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Modding API

Postby aubergine18 » Mon Aug 03, 2015 10:55 pm

iScripters wrote:Not even going to touch modding until it supports Python. Other languages are okay too, but I'm not coming anywhere near Lua. Ugliest language ever.


What specifically is wrong with Lua? I concur it's a bit clunky and missing some features considered standard in most other scripting languages, but it's sufficient for most of the stuff that is applicable to PA.
reeceaclarke
level1
level1
Posts: 39
Joined: Thu Aug 01, 2013 12:02 am
Contact:

Re: Modding API

Postby reeceaclarke » Wed Aug 05, 2015 3:24 am

Lua is quite a nice language for scripting and you can still do surprisingly complex things with it despite it being rather simple for example I have managed to create a mine craft styled terrain generation within a game called roblox(which uses lua) which featured perlin noise and while I would also like to see other languages being supported for example c# I would rather the focus be added on allowing mod creators more freedom within the game to change things.
iScripters
level2
level2
Posts: 205
Joined: Sat Jun 01, 2013 12:36 pm

Re: Modding API

Postby iScripters » Wed Aug 05, 2015 9:16 pm

xander wrote:
iScripters wrote:Not even going to touch modding until it supports Python. Other languages are okay too, but I'm not coming anywhere near Lua. Ugliest language ever.

That's nice, dear. I am sure that we are all missing out on the amazing mods that you would have created, had Prison Architect supported a scripting language that is more to your liking.

xander

No need for the sarcasm, cowboy. I actually do make cool mods for other games, using Python. Which you are missing out on indeed.
The thing I dislike most about lua is the ugliness of the syntax.. it almost hurts reading it, let alone writing it..
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Modding API

Postby xander » Thu Aug 06, 2015 5:07 pm

iScripters wrote:No need for the sarcasm, cowboy.

It was more sardonicism than sarcasm. That being said, while it might not have been necessary, neither was your pointless post about how ugly Lua is. Your like my troofer uncle who mentions that Bush brought down the World Trade Centers whenever an opportunity arrises. Your disdain for Lua is not really relevant to this thread.

iScripters wrote:I actually do make cool mods for other games, using Python. Which you are missing out on indeed.

Cool story, bro.

iScripters wrote:The thing I dislike most about lua is the ugliness of the syntax.. it almost hurts reading it, let alone writing it..

That's nice, dear. Have you ever heard the expression, "a poor craftsman blames his tools?" If you actually cared about modding Prison Architect, I suspect that you would learn to use the tools that are available. From what you have posted here, all I know is that you think rather highly of your modding abilities, but that you really dislike Lua and think that python is amazing. Good for you.

xander
iScripters
level2
level2
Posts: 205
Joined: Sat Jun 01, 2013 12:36 pm

Re: Modding API

Postby iScripters » Thu Aug 06, 2015 6:51 pm

xander wrote:blablabla
...
Your like my troofer
...
blablabla


You're*
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: Modding API

Postby xander » Thu Aug 06, 2015 9:58 pm

iScripters wrote:You're*

You know, I always wonder about the kind of person that feels the need to call out people for errors in usage, grammar, spelling, etc. On the one hand, it seems like a kind of ego stroking ("Hey, look at me! I know güd grammerz! Aren't I superior?"). On the other hand, it is an interesting kind of ad hominem attack ("I don't have to respond to my critics, as they are clearly too stupid to be bothered with!"). Of course, your entire argument is that you are a fantastic modder who is only limited by the ugliness of Lua (which is another interesting logical fallacy: you've not actually provided any examples of this ugliness, just used it as an excuse to deprive the world of your genius).

xander
iScripters
level2
level2
Posts: 205
Joined: Sat Jun 01, 2013 12:36 pm

Re: Modding API

Postby iScripters » Fri Aug 07, 2015 6:29 am

xander wrote:Of course, your entire argument is that you are a fantastic modder


Nope. Never said I'm a "fantastic modder". I make mods, (like these: http://forum.pluton-team.org/resources/ ... pters.107/)

xander wrote:you've not actually provided any examples of this ugliness


Do I really need to give an example or proof, to support my own opinion? That seems off..
hppavilion1
level1
level1
Posts: 14
Joined: Thu May 21, 2015 7:02 am

Re: Modding API

Postby hppavilion1 » Sat Aug 22, 2015 10:46 pm

iScripters wrote:Not even going to touch modding until it supports Python. Other languages are okay too, but I'm not coming anywhere near Lua. Ugliest language ever.

News flash: Python will never be supported. I agree that it is best language ever, but it would be REALLY hard to implement for a project like this. Just find a Py2Lua program, and you can mod it NOW! :)
YMS
level1
level1
Posts: 73
Joined: Sun Nov 30, 2014 10:31 am

Re: Modding API

Postby YMS » Sat Sep 12, 2015 11:40 pm

aubergine18 wrote:Outside of campaign mode I don't think there's any way to create new windows or messages to the user. In normal game mode the required functions don't exist in the Game library.


Inside the campaigns (i.e. the DeathRow campaign), the Game library is the same. If I call something like

Game.AdviserSay("Chief", "adviser_deathrow_postmurder4")


I will get a runtime error there as well. If I check the script Explorer, the Game object there has two methods only, too, just like in the sandbox mode. Yes, the campaign's Lua scripts use all these fancy functions like the one I just quoted, but it seems like mods cannot use it (and most of the documentation under http://devwiki.introversion.co.uk/pa/index.php/Lua is pointless).

If I'm missing something out, please correct me. I took I first look on the whole modding system just now.

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 4 guests