Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chdoc
Copy link
Member

@chdoc chdoc commented Jan 25, 2024

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
Copy link
Member

myk002 commented Jan 27, 2024

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.

distance = d
end
end

Copy link
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
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
Copy link
Member Author

chdoc commented Jan 28, 2024

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.

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