Ludeon Forums

Ludeon Forums

  • December 05, 2022, 10:42:25 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: [Mod Request] Doors that prisoners can open.  (Read 11162 times)

Humort

  • Drifter
  • **
  • Posts: 92
  • keelah se'lai
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #15 on: January 07, 2015, 05:04:24 AM »

Может попробовать сделать такую дверь, которая будет делать комнату - закрытым помещением, но эту дверь, заключённые не будут воспринимать за дверь? (ну, как вариант, свежая мысль)...
Logged
I speak Russian if you don't understand that I wrote, Google Translator is guilty of it

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2136
  • Shadow
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #16 on: January 07, 2015, 06:31:22 AM »

Please use english on this forum. Most people here can't even read the kyrillian alphabet..
Logged

Loki88

  • Colonist
  • ***
  • Posts: 512
  • Evil Muffalo
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #17 on: January 07, 2015, 07:58:52 AM »

Hmm, it is much more complicated than I thought at first glance.
The problem is, that the room is a prison and the outer room and also the door is not a prison.
Therefore the prisoner won't ever leave the room...

I've tried it with my lockable doors from miscellaneous and still cant get the prisoner to walk into the second room. Even a prison bed in there doesn't work, as the door stays a non prison room..

Sorry but it isn't easily done. It looks like it needs some deep pawn or some room definition coding.
Sorry, but no easy prison architect clone doable here..



If you want to try it yourself, here is my test mod with the LockableDoors code:
http://www.mediafire.com/download/rc3786cu6g96m4g/Prison.7z

Feel free to do with it whatever you like.

Would this code still be viable in A8 or have things changed enough between alphas that this code isn't any good?
Logged

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2136
  • Shadow
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #18 on: January 07, 2015, 10:59:40 AM »

Honestly, I'm not sure. But the source I used for this is a slightly modification of the locked door part from the Miscellaneous mod. You can find the sourcecode there at the end of the first post.
I'm not home right now, or I would look for you...
Logged

Carry

  • Drifter
  • **
  • Posts: 30
  • Refugee
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #19 on: January 28, 2015, 09:40:39 AM »

I think I got it - almost, maybe  :)

ProofOfConcept.zip

The file contains a new door and a workgiver. The door can be opened by anyone and the workgiver prevents wardens from escorting the prisoner back to his cell (if his current room is a cell).

Notes:
The room on the 'other side' needs a prisoner bed. Afaik that's the only way to turn a room into a prison.
Wardens still bring food to prisoners. I'm sure that can be turned off in the workgiver as well.

I didn't test anything besides the basic function - there might be side-effects.

Feel free to use the code. I don't have time to make a proper mod right now.



[attachment deleted due to age]
Logged

ousire

  • Drifter
  • **
  • Posts: 81
  • Refugee
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #20 on: January 28, 2015, 10:33:44 AM »

I think the best solution would be the ability to mark rooms as 'for prisoner use', and if two prisoner rooms are connected to each other, then they'll be able to freely move between the different rooms. Then you can have individual cells that connect to halls, dining areas, outdoor yards, you name it
Logged

Wastelander

  • Drifter
  • **
  • Posts: 94
  • Organ Farm
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #21 on: January 28, 2015, 01:56:36 PM »

Quote
I think the best solution would be the ability to mark rooms as 'for prisoner use', and if two prisoner rooms are connected to each other, then they'll be able to freely move between the different rooms. Then you can have individual cells that connect to halls, dining areas, outdoor yards, you name it

I've implemented this in a mod I'm working on... in total I had to:
-Create a new door that prisoners can access
-Override default human thinkTree so prisoners no longer just wanderRoom, they wander freely, or else they won't go to access shared resources outside their cell (nutrient dispensers)
-Override the warden workgiver to not haul prisoners who are out of their bedroom, and to not haul prisoners who are in 1x1 rooms (as the prison door itself creates a 1x1 room)

I'm at the point where they'll access their own bedrooms and leave the bedrooms to get food from a shared dispenser.  Still on my list is to build an object that works like a bed but marks a room as a prisoner zone, because only prisoner-marked beds do that in core.
Logged

Vader

  • Drifter
  • **
  • Posts: 38
  • Refugee
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #22 on: January 28, 2015, 02:03:06 PM »

Looking at this code:
Code: [Select]
    public void RoomChanged()
    {
      this.cachedCellCount = -1;
      this.cachedOpenRoofCount = -1;
      if (Map.Initialized)
        RoofMaker.TryGenerateRoofFor(this);
      this.isPrisonCell = false;
      if (!this.TouchesMapEdge)
      {
        foreach (Thing thing in this.AllContainedThings)
        {
          Building_Bed buildingBed = thing as Building_Bed;
          if (buildingBed != null && buildingBed.ForPrisoners)
          {
            this.isPrisonCell = true;
            break;
          }
        }
      }
I propose to make the prisoners detector, who will act as a "bed".
So it will be easy to determine which rooms can move prisoners. The detectors will be invisible object.
« Last Edit: January 28, 2015, 02:07:21 PM by Vader »
Logged

Facepunch

  • Colonist
  • ***
  • Posts: 249
  • Refugee
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #23 on: January 31, 2015, 05:42:15 PM »

If ever someone uploads a solution to this issue, you will have forever gained my affections.
Logged

Wastelander

  • Drifter
  • **
  • Posts: 94
  • Organ Farm
    • View Profile
Re: [Mod Request] Doors that prisoners can open.
« Reply #24 on: February 05, 2015, 01:54:34 AM »

Well who could resist eternal affections?  :)

I've uploaded a mod that does this here: https://ludeon.com/forums/index.php?topic=10069.0
Logged
Pages: 1 [2]