RimWorld

RimWorld

Food Is Not Reserved For Prisoners
17 Comments
Zombie Aug 10 @ 8:09am 
1.5 for us neanderthals?
Avarice Jul 26 @ 2:45pm 
well that makes me super excited! Time to wait even more impatiently for my most used mods to update for 1.6. XD

this problem has haunted me for a looong time. Awesome! I was ready to play games with hauling zones to ensure food was nearby if I could only stop auto hauling. This "compromise" is great.
VitaKaninen Jul 23 @ 6:39pm 
Nice!
"Just Harry"  [author] Jul 23 @ 6:38pm 
There's more demand than I anticipated for allowing automatic hauling.

Well—I am a man of the people, so I've added an option for allowing automatic hauling :csdsmile:

To avoid the issue of pawns getting stuck in an infinite loop of delivering food only to immediately haul it back to whence it came, I've implemented a small compromise: food delivered to a prison by a warden, or manually dropped in a prison from a pawn's inventory, is temporarily reserved-for-prisoners for nine hours (that duration is configurable).

When a thing of food is selected, if it's temporarily reserved-for-prisoners it will have a gizmo for prematurely cancelling that reservation.
Avarice Jul 23 @ 4:04pm 
I would personally love a mod that allowed automatic hauling away of food in a prison cell, the trade off of not delivering prison food would be small for me. Although I personally imagine changing/removing jobs is a headache which is why I havent even bothered looking into it

I will without a doubt use and love this mod. (this mod as in the one you posted and i'm now subscribed to, not the hypothetical.)
Kupie Jul 23 @ 11:08am 
Thanks for this! Drove me crazy that for the prison I'd have to right click -> Pick up (which I think is part of pick up and haul) -> manually go drop the items out of prison
Adora Jul 22 @ 11:23am 
I just started running into this issue with prisoner's that produce food items like insect jelly and what not with the biology stuff. It's crazy to see this initially uploaded so recently when I assume people have struggled with this for years. This is very helpful!

I've been searching all over, and I do not know how to mod, but is it possible to remove the prisoner reserved food function all together? Like if I wanted to give my prisoner's food, I could designate a stockpile in the prison, this way I could also specify what meals they get, or do not get if I am experiencing a food crisis, and make it a dumb labor hauling job.

The meal delivery job to prisoners is a pretty silly one overall IMO.

This mod fixes my immediate problem, but something that removes the prison food restriction entirely would require less manual management.

Thank you!
VitaKaninen Jul 21 @ 6:26am 
I see, Thanks!
"Just Harry"  [author] Jul 21 @ 6:23am 
The original intention is to make it possible to haul food out of a prison at all.

The vanilla behaviour is such that it's impossible to haul food out of a prison, because: the right-click-menu option for hauling is disabled for food in a prison; the vanilla haul-designator has no effect on food in a prison; and colonists won't automatically haul food that's in a prison (even if it's not in a stockpile, and even if there's a higher priority stockpile elsewhere).

With a mod-added hauling-designator that affects food in a prison, the value-proposition of this mod is lessened, yes :D

Also, I realise now that I can't add an option to make this affect automatic hauling, because that would break the "Deliver Food" job for prison wardens (the delivered food could get hauled away before the prisoner eats it).
VitaKaninen Jul 21 @ 5:58am 
Well, that is how I would use this mod, but maybe I am not understanding what your intention was.

I use the Pick up and Haul mod, so I can already manually tell them to haul it or pick it up. If this mod just does the same thing, then maybe I don't need it. I thought it freed up the food items so that haulers would come by and pick them up if I strip a prisoner in the prison, or if too many meals get dropped in there for some reason.

If I still have to manually tell them to haul it, then I can already do that with the other mod, so maybe I don't understand what this mod is attempting to fix, or how you intend for it to be used.

Is this intended for people who are not using Pick up and Haul, and have no other way to move food out of the prison?
"Just Harry"  [author] Jul 21 @ 1:00am 
Indeed, Allow Tool's urgent-hauling job doesn't count as being forced unless the right-click-menu is used, internally it uses the vanilla hauling job (see https://github.com/UnlimitedHugs/RimworldAllowTool/blob/cc168e824f883582ef2e1e3fab9225ae9594ba1d/Source/AI/WorkGiver_HaulUrgently.cs#L12-L14) .

I suppose I could add a mod option to make this mod's changes also affect automatic hauling, if that's the desired behaviour?
VitaKaninen Jul 20 @ 6:11pm 
So, the food does not show as being reserved for prisoners, but when I mark it to be urgently hauled using Allow Tool, the pawns will still not do it automatically. I have to manually tell them to haul it.
VitaKaninen Jul 18 @ 12:56pm 
Thanks for the explanation!
"Just Harry"  [author] Jul 18 @ 12:45pm 
[1/3]
For change 2—the removal of the ": Reserved for prisoners" suffix—that's a purely cosmetic alteration, so there's nothing worth note there.

For change 1—permitting colonists to be forced to haul food/things reserved for prisoners—the "Reserved for prisoners" message used by the game is overselling the situation: nothing is actually reserved for prisoners, it's simply considered socially improper for colonists to interact with the item; you see, internally there is a method named `SocialProperness.IsSociallyProper`, it's used to check if it's considered socially proper for a pawn to interact with a thing.

The gist of it is that, for some things, social properness matters, and for those things, it's socially proper for a prisoner to interact with them if the prisoner and the thing are in the same room – for a colonist, it's socially proper to interact with such a thing if the thing is not in a prison-cell.
"Just Harry"  [author] Jul 18 @ 12:45pm 
[2/3]
I suspect that this notion of social properness is in place to avoid having colonists pop into a prison, for a meal, simply because it's nearby.
Now, this is not what this mod modifies, this explanation of social properness is just for context.

What this mod does modify is a method named `HaulAIUtility.PawnCanAutomaticallyHaulFast`, which is used to check if a pawn can haul a thing. This method receives a boolean specifying whether or not the pawn is being forced to haul the thing—to the best of my knowledge a pawn is forced to do something if the player instructs them to do it via the right-click menu.
This method has a special-case for human-ingestible food items: wherein if the food isn't socially proper for the pawn, the pawn is prevented from hauling it; this makes sense for automatic hauling, as you don't want a colonist to drop some food in a prison only for them to immediately haul it back to where they got it from.
"Just Harry"  [author] Jul 18 @ 12:45pm 
[3/3]
But for forced, player-directed hauling, this makes no sense; why would they care about some notion of propriety when the only remaining food in the colony just so happens to be in a prison? They wouldn't. They should just be able to haul it when the player forces them to.

Now, there is a very slight opportunity for mod incompatibility here: if any other active mods are misusing `HaulAIUtility.PawnCanAutomaticallyHaulFast` by supplying `true` for the `forced` parameter, even when the hauling isn't forced, colonists may end up automatically hauling food in prisons when they shouldn't; but that would be a bug arising from those mods.

It should all just work fine, unless the player has mods with buggy handling of hauling active.

To summarise the previous 400-odd words: I think it's just an oversight.
VitaKaninen Jul 18 @ 7:45am 
Do you know what the dev's original intent was by having food reserved by prisoners? Was it to prevent someone from delivering food to a prisoner, and then another person stealing it before the prisoner can eat it, creating an endless work loop in a larger colony?

Are there are other situations we need to watch out for when using this mod?