I could easily be wrong, but perhaps this could be handled with a couple of small checks every time a path point is reached. From what I have seen, it seems like pathfinding is handled in segments and recalculated after each segment completes (which I'm referring to as a path point). If that's correct, perhaps something like the following pseudocode at those points:
And there would be a check for the inverse as well (removing overclothes) with similar logic. Obviously, I have no idea what the code really looks like or if the classes have these sorts of attributes and functionality, but I imagine that something similar to this would be fairly inexpensive and worthwhile. This particular code assumes that path checks are done at least once every time the colonist enters a new room, but if they are not, perhaps there is another check when colonists do enter rooms where this could be added.
It would mean that colonists would change their overclothes at a coat/hat rack only if it were placed in a room with a door that led to the outdoors, and only if a colonist's clothing settings (already in the game) had an "Auto Overclothes" option checked by the player (or if it were checked by default, but should probably have the ability to be overridden); coat/hat racks placed in rooms that are not adjacent to the outdoors could still be used to manually store overclothes.
Sorry to resurrect this thread, but I wanted to suggest this very thing and did a search first. It wouldn't be the cheapest thing to implement (although not too bad, I imagine), because it does require a new item, a new kind of behavior which distinguishes overclothes (all jackets and hats, and potentially armor) from other clothing, and an association between the two. But Tynan mentioned the AI cost, and I was wondering if the above logic would work, or if I'm missing something (easily the case).
Code Select
if (
colonist.current_location.indoors == true &&
colonist.next_path_point.indoors == false &&
colonist.current_room.contains(clothing_rack) &&
colonist.settings.auto_overclothes == true
) {
colonist.task_queue.push_to_front(task.don_overclothes, colonist.current_room.get_clothing_rack())
}
And there would be a check for the inverse as well (removing overclothes) with similar logic. Obviously, I have no idea what the code really looks like or if the classes have these sorts of attributes and functionality, but I imagine that something similar to this would be fairly inexpensive and worthwhile. This particular code assumes that path checks are done at least once every time the colonist enters a new room, but if they are not, perhaps there is another check when colonists do enter rooms where this could be added.
It would mean that colonists would change their overclothes at a coat/hat rack only if it were placed in a room with a door that led to the outdoors, and only if a colonist's clothing settings (already in the game) had an "Auto Overclothes" option checked by the player (or if it were checked by default, but should probably have the ability to be overridden); coat/hat racks placed in rooms that are not adjacent to the outdoors could still be used to manually store overclothes.
Sorry to resurrect this thread, but I wanted to suggest this very thing and did a search first. It wouldn't be the cheapest thing to implement (although not too bad, I imagine), because it does require a new item, a new kind of behavior which distinguishes overclothes (all jackets and hats, and potentially armor) from other clothing, and an association between the two. But Tynan mentioned the AI cost, and I was wondering if the above logic would work, or if I'm missing something (easily the case).