Questions about Modding

Discussion about Mods for Prison Architect

Moderator: NBJeff

CeaselessSoul
level0
Posts: 2
Joined: Sun Jan 03, 2016 3:58 am

Questions about Modding

Postby CeaselessSoul » Sun Jan 03, 2016 4:25 am

Disclaimer: Just joined this forum so forgive me anything stupid I do or don't know.

I'm going to get straight to the point:

How do I view the Script Debugger? The Lua function list says it's opened if you call the function "DebugOut", but that's not the case. It only opens when there's an error (at least it opens). I've also found several bugs with the Script Debugger. Such as you can only run one command in the command bar before it breaks. (is there a limit to how many characters are allowed to be typed in the command bar?)
> PS: At the top of the Script Debugger it says F3 in parentheses (assuming that means it's the key shortcut). F3 seemingly does nothing (clicking "Close" also does nothing, the two top-right buttons don't have any indication of what they do).

The only documentation I've seen so far is the Lua function list. Maybe I'm looking in the wrong places, but it seems very hard to create a mod mainly just because there's no clear distinction of what to do. I've dabbled in it a bit and got some things to print, looked at the Explorer to see any extra information I may have missed. (and yes, I've looked at tutorials)

Another question, how do I coordinate which script corresponds to which object? I've done some messing around and it seems to be objects with the same name as the script, but I'm not sure. Everything I'm doing just seems to be guess and check, trial and error. Any help or insight would be very much appreciated.
User avatar
Ghost314
level1
level1
Posts: 24
Joined: Thu Dec 24, 2015 9:23 pm

Re: Questions about Modding

Postby Ghost314 » Sun Jan 03, 2016 5:20 am

To get the script debugger to pop up, you have to select an object in the game world that has your script attached and press F3. This will only work for objects that you have written a script for. The scripts are indeed attached to objects based on the object name, as defined in materials.txt. I've tried typing stuff into the script debugger, but I find that it rarely works, instead I generally use Game.DebugOut() to print strings to the debugger in my scripts, then open the debug window and inspect the results. The right most button at the top right will close the debug window (but if your script is throwing an error every frame, it will be automatically re-opened).

I learned everything I needed to start modding from these two sources: https://github.com/aubergine10/Prison-A ... t-API/wiki and https://steamcommunity.com/sharedfiles/ ... =480978426 I also learned quite a bit from downloading other people's mods that do complex things and looking at what they did. This is how I found out, for example, that you can create your own jobs by defining a jobs.txt file in your mod folder (the stock game doesn't even have a jobs.txt file!). I have often wondered how the first few modders figured out some of these undocumented features, did someone really just think to themselves: "I think I'll see what happens if I put in a jobs.txt file!", but then I also heard something about decompiling on another wiki, so I suppose that might have had something to do with it, or maybe it's buried in official release notes somewhere. :?
CeaselessSoul
level0
Posts: 2
Joined: Sun Jan 03, 2016 3:58 am

Re: Questions about Modding

Postby CeaselessSoul » Sun Jan 03, 2016 5:58 am

Thanks a bunch, Ghost, but I think may wait a bit...

Image
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Questions about Modding

Postby Brento666 » Tue Jan 05, 2016 8:31 pm

CeaselessSoul wrote:Thanks a bunch, Ghost, but I think may wait a bit...

Hi CeaselessSoul,

It all depends on your ambitions; Don't try and make the most revolutionary mod straight out of the gates..
Just start on some small ideas, separate them into small mods and see what works and what doesn't, then go from there.

Retexturing stuff is fun and easy...but scripting stuff can be tedious if you aren't that familiar with programming(!)

Definitely download other's mods to dissect how they work. It can all be A LOT OF FUN...
(Just so long as you don't aim for the stars with your first endeavors! 8) )

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 9 guests