Allow players to assign multiple allowed areas

Started by ChippedChap, March 12, 2017, 07:25:19 PM

Previous topic - Next topic

ChippedChap

In the current version of the game, if you want to stop a colonist from interacting with objects far away from your base, you assign them to the home area and it works fine. If you want to keep a colonist from interacting with something inside your base, you make an area that allows everything to your colonists besides the restricted area and it works.

But it all falls apart if you want your colonist to stay in the home area AND not interact with something inside your base. For this, you would have to create a new area where both the home area and the "interact with anything but this" area overlap. This would require painstakingly switching through areas and guessing where each area is to remove places where the areas don't overlap. It's also tougher if you have to account for three or more areas at once.

My suggestion is that players should be able to shift-select multiple allowed areas for one colonist in the restrict tab. When a player selects two or more areas, whatever gives the jobs checks if the object to be "jobbed" on is on a tile where all the areas overlap. If that object is not allowed in one of the areas, that colonist cannot perform a job on that object.

I guess that this would be very easy to implement. There would be an array in the colonist object storing all the areas the colonist is assigned to. The function, class or whatever combination of objects that gives jobs to colonists would then iterate through all the assigned areas and check if the target object(s) are in each of the areas. If an object is not in one of the assigned areas, the job giver object returns with nothing or a null job. I'm not really sure on the vocabulary of my explanation since I haven't really found the piece of code that does this (ILSpy is open right now, was trying to find it before this post) and I'd appreciate any pointers to that object/function. I might even be able to do it in a non-hacky way if I knew how to inject custom code (hint hint tutorial?).

I really hope this gets implemented. I came up with this idea after having one of my haulers going out and getting shot by snipers while trying to haul something near a siege camp.

Oh and sorry for the text wall.

Calahan

+1.

I would love this feature personally, as I've lost count of how much real time (and how much annoyance I've accumulated) I've wasted by having to micromanage Pawns and zones when I want a Pawn(s) to sporadically do jobs outside their zone, but do not want to unrestrict them, nor change any of my current zones. Not only for the issue inside a base you mention, but also in regards sowing/harvesting crops. As I might want a Pawn(s) to be restricted to inside a base, but to be allowed outside when there's an outside job to be done. But currently, I have to check if plants need sowing/harvesting, and then switch a Pawn(s) to another zone to allow them outside to do plant work. Which gets old, and annoying, very quickly.

So either this feature, or simply allow a lot more zones (so that each Pawn could have their own personalised zone for example). But this solution would be easier in several ways I think.

b0rsuk

I'm a programmer so I have no issues with set operations and boolean logic. Advanced zones might scare less nerdy players, though.

These are animal zones I used in the last game:
BEAR - everything but the fridge, prison, and kitchen. Bears can hunt and they're currently the apex predator in Rimworld.
Wargs - wolves and bigger carnivorous animals. Roughly equal to home minus fridge, prison, kitchen plus raider body dumping site.
Grazing - grazing animals have an extra requirement of not being allowed into growing zones.
Raid - for when animals need to hide

In general I would really benefit from multiple allowed zones. I reuse zones instead of creating a new zone for every type of animal or colonist with special needs. I had a staggeringly ugly colonist (-80 relations!) too.