Ordering objects to be moved

Discussion about Mods for Prison Architect

Moderator: NBJeff

iamihop
level1
level1
Posts: 10
Joined: Fri Dec 20, 2013 1:08 pm

Ordering objects to be moved

Postby iamihop » Sun Sep 07, 2014 3:03 am

I have another question as I try to figure things out.

I have book objects that are created by a script upon completion of a job. I would like to have them be delivered to bookshelves around the prison (preferably by prisoners working in the Library, but not necessarily), and to remain there until they are read. Currently, I have added a production rule in an attempt to accomplish this:

Code: Select all

BEGIN ProductionRule       
    Rule                    Storage
    Material               Book
    Container             Bookshelf
    Distribution          Random
    WorkGroup         TheLibrary
    Worker            Prisoner
END


(The last two lines were added recently, in an attempt to improve it, and I'm not sure that they do anything at all.

The workmen dutifully come to the library and take the books to bookshelves all over the prison. However, the books don't stay there for more than a few minutes before another workman whisks it off to a different bookshelf. This continues ad infinitum. How can I make them leave the books alone once they're on bookshelves?
User avatar
HookerHeels
level1
level1
Posts: 42
Joined: Mon Aug 19, 2013 7:23 am
Location: Texarkana, Texas.

Re: Ordering objects to be moved

Postby HookerHeels » Sun Sep 07, 2014 6:42 am

Not sure. I've been working solely on one mod and haven't done anything like this yet. Tho I suspect I'll find it when I get to it.
dean.fitz
level0
Posts: 5
Joined: Tue Jan 01, 2013 12:02 am

Re: Ordering objects to be moved

Postby dean.fitz » Sun Sep 07, 2014 8:38 am

What is the code for the book?
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Ordering objects to be moved

Postby Rufus » Sun Sep 07, 2014 8:45 am

Are you sure there isn't a line like "from Crate" or something? If not, I imagine the devs actuallu would change book into storedbook when it reaches the shelf, in order to prevent this happening in other similar scenarios. This stored book could then be taken by a prisoner to a cell, where it becomes readingbook then, once a lua script says when it finishes have it be turned back into book so it gets taken to the library.
Suthek
level1
level1
Posts: 29
Joined: Mon Sep 01, 2014 5:23 pm

Re: Ordering objects to be moved

Postby Suthek » Sun Sep 07, 2014 12:51 pm

iamihop wrote:The workmen dutifully come to the library and take the books to bookshelves all over the prison. However, the books don't stay there for more than a few minutes before another workman whisks it off to a different bookshelf. This continues ad infinitum. How can I make them leave the books alone once they're on bookshelves?


That's what the task says. "Take a book and bring it to a bookshelf".
Try this.

Code: Select all

BEGIN ProductionRule       
    Rule                    Storage
    Material               Book
    Container             Bookshelf
    Distribution          Random
    WorkGroup         TheLibrary
    Worker            Prisoner
    Condition            NotLoaded
END


The 'NotLoaded' condition should stop them from touching the books if they are loaded onto any object. (or at least the object that is defined as container).
iamihop
level1
level1
Posts: 10
Joined: Fri Dec 20, 2013 1:08 pm

Re: Ordering objects to be moved

Postby iamihop » Sun Sep 07, 2014 8:31 pm

Thanks for the ideas, guys.

The Book does not have a .lua script at the moment. I don't know how to use the script to have the book get moved to a bookshelf, but I don't know any way other than the scripts to spawn/delete objects (such as using a "storedbook" or "readbook"). Is there a way to have the Book know that it's on a bookshelf within the script?

I have tried including several condition statements, including 'NotLoaded,' and the workers continue to shuffle the books around.

This is still stumping me, because of the apparent gap between the lua scripts and the production.txt instructions.
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Ordering objects to be moved

Postby Rufus » Sun Sep 07, 2014 9:29 pm

I have a feeling this verison of PA is a bit buggy. Not entirely sure though. Just, I had this problem with guards shuffling prisoners around then never uncuffing them.
User avatar
dsdude123
level2
level2
Posts: 77
Joined: Tue May 27, 2014 2:40 am
Location: Seattle,WA
Contact:

Re: Ordering objects to be moved

Postby dsdude123 » Mon Sep 08, 2014 3:25 am

Not sure if this will work but it is worth a shot, set Distribution to Nearest

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest