[MOD] Outhouses

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
Ghost314
level1
level1
Posts: 24
Joined: Thu Dec 24, 2015 9:23 pm

[MOD] Outhouses

Postby Ghost314 » Sat Jan 02, 2016 2:28 am

I have finally finished my first mod for Prison Architect, it adds a new Outhouse object to the game, that looks a bit more natural in open/public areas, like a yard. There are some lingering issues, most of which stem from Prison Architect not allowing me to declare a new object to be 'water dependant', but I think what I have is reasonable. I uploaded my mod to the steam workshop, you can check it out here: http://steamcommunity.com/sharedfiles/f ... =590316659
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: [MOD] Outhouses

Postby xander » Sat Jan 02, 2016 6:14 am

Those blue outhouses are not normally water dependent, anyway. Rather, there is a large tank full of chemicals into which people make their deposits, which must be pumped out every so often. Perhaps the outhouses should generate garbage?

xander
User avatar
Ghost314
level1
level1
Posts: 24
Joined: Thu Dec 24, 2015 9:23 pm

Re: [MOD] Outhouses

Postby Ghost314 » Sat Jan 02, 2016 4:13 pm

xander wrote:Those blue outhouses are not normally water dependent, anyway. Rather, there is a large tank full of chemicals into which people make their deposits, which must be pumped out every so often. Perhaps the outhouses should generate garbage?

xander


Interesting idea, it would definitely be easier to implement. I've also been thinking about the possibility of having an 'occupied' vs 'unoccupied' version of the outhouse sprite, similar to how laundry machines will show an open/closed door when being used. Maybe I'll release a version 2.0 after gathering some more suggestions.
User avatar
Ghost314
level1
level1
Posts: 24
Joined: Thu Dec 24, 2015 9:23 pm

Re: [MOD] Outhouses

Postby Ghost314 » Sun Jan 03, 2016 3:48 am

I ended up starting work on a second version, current plan for outhouses is to remove water dependency and create a new job for cleaning the outhouse, that has to be completed after a certain number of uses. I'd also like to make it so the outhouse starts to produce a new garbage item called 'bio waste' that affects prisoners' 'environment' need, if it's not cleaned in a reasonable amount of time. Instead of getting the doors to work, I ended up doing something else that was bothering me, outhouses still don't look right in indoor public areas like the canteen, I want a proper bathroom stall. Since I already did all the necessary work with the first implementation of outhouses, all I really needed to do was draw up some new sprites. I even inserted some logic to make north/south facing bathroom stalls detect adjacent bathroom stalls and switch to a seamless version of the sprite, so you can place a bunch in a row and they'll all link together nicely. I'm still not really happy with the left/right facing versions of the sprite, but the final result will probably look something like this.

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

Re: [MOD] Outhouses

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

Looking very nice!!

Loving the stalls, hope you do get sideways looking a bit better, but awesome stuff !!

Outhouses usually work with blue gunk in them, the result is rather chemical, not sure if I'd call it bio-waste, chemical waste or bio-chemical-waste :D Or something else even; "Excrement"...

For the clean job; I'd split out 2 jobs (for the fun of it);
-Empty tank
-Clean latrine

If either job isn't done and the toilet is used (multiple times), it should start spawning garbage..! (especially if the tank isn't emptied)

If you need any help scripting the bog/jobs (efficiently) ; hit me up!
-> Because I think this mod is awesome! :mrgreen:
User avatar
Ghost314
level1
level1
Posts: 24
Joined: Thu Dec 24, 2015 9:23 pm

Re: [MOD] Outhouses

Postby Ghost314 » Wed Jan 06, 2016 3:08 am

Brento666 wrote:Looking very nice!!

Loving the stalls, hope you do get sideways looking a bit better, but awesome stuff !!

Outhouses usually work with blue gunk in them, the result is rather chemical, not sure if I'd call it bio-waste, chemical waste or bio-chemical-waste :D Or something else even; "Excrement"...

For the clean job; I'd split out 2 jobs (for the fun of it);
-Empty tank
-Clean latrine

If either job isn't done and the toilet is used (multiple times), it should start spawning garbage..! (especially if the tank isn't emptied)

If you need any help scripting the bog/jobs (efficiently) ; hit me up!
-> Because I think this mod is awesome! :mrgreen:


It was easy enough to get the new jobs defined, but I'm having issues with one subtlety I wanted to implement. Since the actual cleaning part is a pretty straightforward task, I wanted to make it so that the job could be done by prisoners on cleaning duty, and not just Janitors, but when I try to define Prisoner as a Worker for the job in jobs.txt, it seems to crash the game client whenever prisoners start the work time slot in the regime (neat :twisted: ).

My biggest concern with respect to scripting efficiency, is the logic I'm trying to use to figure out when a bathroom stall (which is actually a Toilet object in disguise) has been dismantled. I couldn't find a reasonable way of determining whether or not a Workman is currently dismantling something. Their JobId property doesn't seem to change when they do, nor does the object that they dismantled seem to fire a JobComplete_Dismantle() function. I also couldn't find a good way of getting notified in script when an object has been removed from the game (I might be able to work something out here now, after reading your response to my post on data sharing across scripts, for some reason it didn't work when I tried), which forced me to rely on periodically calling GetNearbyObjects() in the Workman's Update function. I tried to keep it optimized by reducing the scanning range (Workman get really close to an object before dismantling it) and restricting the search to a single type of object, but running a load test with 1.5K Workman building 2K bathroom stalls with my mod enabled, vs 2K Toilets with my mod disabled, I can definitely see an impact when running on fast forward. I'm not sure how realistic that test is, but I would prefer my mod to have no significant performance impact at all.

To solve the issue of constantly calling GetNearbyObjects() I have been toying with the idea of trying to spawn a single instance of an invisible game object that can't be destroyed, so that I can have a script that I know will always be instantiated exactly once. Newly constructed objects can then register with this one script, and send data to it every few frames (a heartbeat). If one fails to send a signal after a certain amount of time, I can detect that an object was removed without relying on GetNearbyObjects inside of the Update function.
User avatar
Ghost314
level1
level1
Posts: 24
Joined: Thu Dec 24, 2015 9:23 pm

Re: [MOD] Outhouses

Postby Ghost314 » Mon Jan 18, 2016 4:41 am

Version 2.0 is finally out, it contains most of the improvements mentioned in this thread, aside from letting prisoners do the outhouse cleaning job (I've pretty much given up on this). The cleaning job is also still a single task. I'm thinking of making a 2.5 version of the mod that contains little more than efficiency optimizations (if I can find any by making use of communication between scripts). After that the last few things I had planned, were to add a new job for pumping the outhouse (which requires the use of a new pump tool) before cleaning it, and defining some new sprites for both outhouses and bathroom stalls that show open/closed doors and switching between them when in use.

That's a lot of new sprites though (especially if I need an open/closed version of each of the seamed/seamless bathroom stall sprites!), so I'm also thinking I might need to make a 'lite' version of this mod, that cuts out some features, but uses fewer sprites, for people that need to combine it with other mods.
bababa3216
level0
Posts: 3
Joined: Tue Aug 18, 2015 4:20 am

Re: [MOD] Outhouses

Postby bababa3216 » Thu Jan 21, 2016 7:53 am

I wanted to make it so that the job could be done by prisoners on cleaning duty,
เล่น gclub ผ่านเว็บ

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests