Skip to content

automatic milking/shearing at closest workshop (WIP) - #958

Closed
chdoc wants to merge 1 commit into
DFHack:masterfrom
chdoc:husbandry
Closed

automatic milking/shearing at closest workshop (WIP)#958
chdoc wants to merge 1 commit into
DFHack:masterfrom
chdoc:husbandry

Conversation

@chdoc

@chdoc chdoc commented Jan 25, 2024

Copy link
Copy Markdown
Member

This is a draft for a tool that will queue milking/shearing orders at the closest farmer's workshop on the same z-level. In order for the tool to shear/milk an animal, there must be a farmer's workshop on the same z-level as the animal. Only the workshop closest to the animal will be used.

Currently, I run this with repeat --time 1500 --command [ husbandry ], but I plan to make it use the enable infrastructure with proper callbacks.

Part of the logic is copied from workorder, so I guess some refactoring may be required.

@myk002

myk002 commented Jan 27, 2024

Copy link
Copy Markdown
Member

It's fine to work the logic out here, but I think this should eventually be moved into workorder and the choice of general workorder vs. at closest shop should be controllable with a commandline option. We can add both versions to gui/control-panel so players have a choice.

Comment thread husbandry.lua
distance = d
end
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if there is no workshop on the animal's level?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then no milking job gets queued, because farmer's workshops that are not next to a pasture are probably intended for other things (processing plants or spinning thread).

@chdoc

chdoc commented Jan 28, 2024

Copy link
Copy Markdown
Member Author

It's fine to work the logic out here, but I think this should eventually be moved into workorder and the choice of general workorder vs. at closest shop should be controllable with a commandline option. We can add both versions to gui/control-panel so players have a choice.

I'm not so sure about this. The workorder tool is primarily about "Creat[ing] manager workorders". Is just happens to have some convenience functionality for dealing with milking/shearing. Besides using the same predicates for checking whether an animal can be milked/sheared -- something that arguably should be moved to a library -- I don't think there's any overlap between the tools.

Now that milking and shearing is working like I would like it to, the next step for me would be to automate cheese making, because, once again, there is no way to reasonably do this using manager work orders.

@chdoc

chdoc commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

Has been superseded by the long merged husbandry tool.

@chdoc chdoc closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants