Skip to content

idle-crafting: add cloth, silk, and yarn crafts - #1618

Open
Alistair-Afton wants to merge 1 commit into
DFHack:masterfrom
Alistair-Afton:idle-crafting-cloth
Open

Alistair-Afton wants to merge 1 commit into
DFHack:masterfrom
Alistair-Afton:idle-crafting-cloth

Conversation

@Alistair-Afton

@Alistair-Afton Alistair-Afton commented Sep 15, 2026

Copy link
Copy Markdown

Summary

Adds clothesmaking support to idle-crafting (DFHack/dfhack#5851). Plant-fiber cloth, silk, and yarn are distinguished via material flags and become MakeCrafts jobs with the matching material_category and job_item flags2 bit — the same pattern strangemood uses for mood cloth requirements.

  • Workshops with input stockpile links count cloth in linked piles and fold it into the weighted random job choice
  • Unlinked workshops try clothesmaking after stonecrafting and bone carving when usable cloth exists on the map
  • CLOTHESMAKER labor is respected in job selection and profile validation, so workshops where clothesmaking is the only permitted craft labor now work correctly

New test/idle-crafting.lua suite (7 tests); docs and changelog updated.

Testing

  • test -t cloth: 7/7 tests pass in-game
  • Live fort: plant cloth, silk, and yarn jobs each fetch the correct material and produce crafts (verified by before/after item counts)
  • ci/lint.py clean

The tool only supported bone, horn, shell, rock, and totem crafting. Cloth
crafts require clothesmaking labor and come in three material categories the
game distinguishes via job.material_category plus a job_item flags2 bit:
plant-fiber cloth (flags2.plant), silk (flags2.silk), and yarn (flags2.yarn),
matching the pattern strangemood uses for mood cloth requirements.

For workshops with input stockpile links, cloth in linked piles is counted
by category and folded into the weighted random job choice. For workshops
without links, clothesmaking is tried after stonecrafting and bone carving
when usable cloth exists on the map.

Workshop profiles that block clothesmaking now correctly report invalid only
when all three supported labors are blocked, and the overlay toggle enables
workshops where clothesmaking is the only permitted craft labor.
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.

1 participant