Skip to content

Commit

Permalink
Merge pull request #4359 from myk002/myk_quickfort_profile
Browse files Browse the repository at this point in the history
document and use quickfort profile setting capabilities
  • Loading branch information
myk002 authored Mar 12, 2024
2 parents 18b55c3 + c1e4736 commit 36cb8eb
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 22 deletions.
18 changes: 9 additions & 9 deletions data/blueprints/dreamfort.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
""
"Other DFHack tools also work very well with Dreamfort, such as autofarm. See the /setup_help blueprint for a suggested list to turn on in the DFHack gui/control-panel."
""
"Once you have your starting surface workshops up and running, you might want to configure buildingplan to only use blocks for constructions so it won't use your precious wood, boulders, and bars to build floors and walls. If you bring at least 7 blocks with you on embark, you can set this to be your default in the Autostart tab of gui/control-panel."
"Once you have your starting surface workshops up and running, you might want to configure buildingplan to only use blocks for constructions so it won't use your precious wood, boulders, and bars to build floors and walls. If you bring at least 7 blocks with you on embark, you can set this to be your default in the Automation -> Autostart tab of gui/control-panel."
""
"Directly after embark, run ""gui/quickfort dreamfort /setup_help"" to get some advice on initial settings, and get started building your fort with ""gui/quickfort dreamfort /surface1"" on the surface (see /surface_help for how to select a good spot). Read the walkthroughs for each level to understand what's going on and follow the checklist to keep track of where you are in the building process. Good luck, and have fun building an awesome Dreamfort-based fort!"
""
Expand All @@ -39,7 +39,7 @@ You are welcome to copy the Dreamfort spreadsheets and make your own modificatio
""
"If you like, you can download a fully built Dreamfort-based fort from https://dffd.bay12games.com/file.php?id=15434 and explore it
interactively."
"# The dreamfort.csv distributed with DFHack is generated with the following command:
"# The dreamfort.csv distributed with DFHack is generated from the online spreadsheets with the following command:
for fname in dreamfort*.xlsx; do xlsx2csv -a -p '' ""$fname""; done | sed 's/,*$//'"
#notes label(checklist) command checklist
"Here is the recommended order for Dreamfort commands. Each line is a blueprint that you run with gui/quickfort (default keybinding: Ctrl-Shift-Q), except where we use other tools as noted. If you set ""dreamfort"" as the filter when you open gui/quickfort, you'll conveniently only see Dreamfort blueprints to choose from. See the walkthroughs (the ""help"" blueprints) for context and details. You can also copy text from this spreadsheet online and paste it in gui/launcher with Ctrl-V."
Expand Down Expand Up @@ -1652,7 +1652,7 @@ with separate stockpiles for:
""
Workshops:
- 2x Stonecutter
- 4x Craftsdwarf
- 4x Craftsdwarf (labor restrictions set to specialize for materials in adjacent stockpiles)
- 1x Jeweler
- 1x Mechanic
- 4x Smelter
Expand Down Expand Up @@ -1816,7 +1816,7 @@ build2/industry_build2
,,,,`,`,`,`,`,`,`,`,`,`,`,`,`,"wj{name=""Encruster"" take_from=""Goods/wood quantum,Stoneworker quantum,Gem feeder""}",`,`,`,`,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,"wr{name=""Stone craftsdwarf""}",`,`,`,`,`,`,`,wt,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,"wr{name=""Stone craftsdwarf"" labor=Stonecrafting}",`,`,`,`,`,`,`,wt,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,`,`,`,`,"trackstopN{name=""Stone/gem dumper"" take_from=""Stone feeder,Gem feeder"" route=""Stone/gem quantum""}",`,`,`,`,`,`,`,`,~,`,`,`,`
,,,,`,`,~,`,`,~,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,wm{max_general_orders=2},`,`,`,`,`,`,`,wm{max_general_orders=10},`,`,`,`,`,`,`,`,`
Expand Down Expand Up @@ -1866,7 +1866,7 @@ build2/industry_build2
,,`,`,`,`,`,`,`,`,`,`,`,`,d,`,,,,`,d,`,`,`,`,`,`,`,`,`,`,`,`
,,`,`,`,`,`,`,`,`,`,`,`,`,,`,`,`,`,`,,`,`,`,`,`,`,`,`,`,`,`,`
,,`,`,`,`,`,`,`,`,`,`,`,`,,,d,,d,,,`,`,`,`,`,`,`,`,`,`,`,`
,,`,`,"wr{name=""Wood craftsdwarf""}",`,`,ew,`,`,ew,`,`,`,`,`,`,`,`,`,`,`,`,`,"wr{name=""Misc craftsdwarf""}",`,`,"wr{name=""Bone craftsdwarf""}",`,`,`,`,`
,,`,`,"wr{name=""Wood craftsdwarf"" labor=Woodcrafting}",`,`,ew,`,`,ew,`,`,`,`,`,`,`,`,`,`,`,`,`,"wr{name=""Misc craftsdwarf"" labor_mask=""Stonecrafting,Woodcrafting,Bone Carving""}",`,`,"wr{name=""Bone craftsdwarf"" labor=""Bone Carving""}",`,`,`,`,`
,,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
,,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
,,,,`,`,`,`,`,`,`,`,`,es,`,`,`,`,`,`,`,es,`,`,`,`,`,`,`,`,`
Expand Down Expand Up @@ -2131,7 +2131,7 @@ build3/services_build3

"#zone label(services_zones) start(18; 18) hidden() message(Don't forget to assign a doctor to the hospital!
If you'd like to fill your wells via bucket brigade, activate the inactive pond zones one level down from where the wells will be built.) garbage dump, hospital, taverrn, barracks, archery range, and pond zones"
,,,,,,,,,,,,"j{name=""Jail 1""}(5x5)",,,,"j{name=""Jail 2""}(5x5)",,,,"j{name=""Jail 3""}(5x5)",,,,"j{name=""Jail 4""}(5x5)",,,,"j{name=""Jail 5""}(5x5)"
,,,,,,,,,,,,,"j{name=""Jail 1""}(4x5)",,,,"j{name=""Jail 2""}(4x5)",,,,"j{name=""Jail 3""}(4x5)",,,,"j{name=""Jail 4""}(4x5)",,,,"j{name=""Jail 5""}(4x5)"
,"b{location=tavern/bigpub name=""Rented room 1""}(1x3)","b{location=tavern/bigpub name=""Rented room 2""}(1x3)","b{location=tavern/bigpub name=""Rented room 3""}(1x3)",,"b{location=tavern/bigpub name=""Rented room 4""}(1x3)","b{location=tavern/bigpub name=""Rented room 5""}(1x3)","b{location=tavern/bigpub name=""Rented room 6""}(1x3)",,"b{location=tavern/bigpub name=""Rented room 7""}(1x3)","b{location=tavern/bigpub name=""Rented room 8""}(1x3)","b{location=tavern/bigpub name=""Rented room 9""}(1x3)",,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`
,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`
,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`,,`,`,`
Expand Down Expand Up @@ -2831,9 +2831,9 @@ Screenshot: https://drive.google.com/file/d/16iT_ho7BIRPD_eofuxdlVQ4FunR1Li23
""
Features:
"- Staged crypt expansion that grows with your, um, need"
- 52 tombs in stage 1
- 160 additional tombs in stage 2 (212 tombs total)
- Extendable in any direction by applying the blueprints multiple times
- 20 tombs in stage 1
- 192 additional tombs in stage 2 (212 tombs total)
"- Extendable in any direction by reapplying the blueprints to the North, South, East, or West, overlapping by one tile"
""
Crypt Walkthrough:
1) Dig out the layer with /crypt1.
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Template for new versions:
- `clean`: protect farm plots when cleaning mud
- `tweak`: add ``quiet`` option for silent enablement and disablement of tweaks
- `gui/teleport`: add global Ctrl-Shift-T keybinding (only avaiable when DFHack mortal mode is disabled)
- Dreamfort: the four Craftsdwarf's workshops on the industry level are now specialized for Stonecrafting, Woodcrafting, Bone Carving, and miscellaneous tasks, respectively

## Documentation
- `overlay-dev-guide`: updated examples and troubleshooting steps
Expand Down
66 changes: 53 additions & 13 deletions docs/guides/quickfort-user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -793,14 +793,14 @@ routes.
Building designation syntax
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Other than names, most buildings do not have any extra properties. See the
`#build mode reference`_ for those that do.

The syntax otherwise looks just like stockpiles, except that it only makes
sense to have a single symbol to indicate what to build on that tile::
The syntax is very similar to the syntax for stockpiles, except that it only
makes sense to have a single symbol to indicate what to build on that tile::

symbol{properties}:configuration(expansion)

See the `#build mode reference`_ for properties that you can specify for each
building type.

Here's an example of a simple 5x5 square of flooring::

#build
Expand All @@ -811,6 +811,11 @@ or a named Jeweler's workshop that takes from specific stockpiles::
#build
wj{name="Encrusting center" take_from="Furniture,Gem storage"}

or a forge that specializes in high-quality armor::

#build
wf{name=Armorer labors=Armoring min_skill=Master}

The ``:configuration`` part is only relevant for hauling routes, which we'll go
over in the next section.

Expand Down Expand Up @@ -2057,14 +2062,49 @@ apply in a different fort.
#build mode reference
~~~~~~~~~~~~~~~~~~~~~

In addition to the type-specific properties listed below, all building types
accept the ``name`` property.

Moreover, all workshops and furnaces accept the ``max_general_orders``
property, which sets the maximum number of general workorders that the building
can accept, and the ``take_from`` and ``give_to`` properties, which are
comma-separated lists of names or building ids (the same as the correponding
stockpile properties above).
In addition to the type-specific properties listed in the symbol table below,
all building types accept the ``name`` property.

Moreover, all workshops and furnaces (both called "workshops" below) accept the
following "profile" properties:

====================== ===========
Property Description
====================== ===========
``max_general_orders`` the maximum number of general workorders that the
workshop will accept
``take_from`` comma-separated list of names or building ids of
stockpiles that the workshop takes from
``give_to`` comma-separated list of names or building ids of
stockpiles that the workshop gives to
``labor`` comma-separated list of labors that should be enabled
for the workshop. all unlisted labors for the workshop
will be disabled.
``labor_mask`` comma-separated list of labors that should be disabled
for the workshop. all unlisted labors for the workshop
will be left enabled. if both the ``labor`` and
``labor_mask`` properties are specified, the ``labor``
property takes precedence.
``min_skill`` the minimum skill rating for units that perform jobs at
the workshop
``max_skill`` the maximum skill rating for units that perform jobs at
the workshop
====================== ===========

For the ``labor`` and ``labor_mask`` properties, you can use either the labor
ID or the readable caption string. You can see both options by running::

:lua for idx,name in ipairs(df.unit_labor) do cap=df.unit_labor.attrs[idx].caption if cap then print(('%22s %25s'):format(name, cap)) end end

For example, you can specify either ``BONE_CARVE`` or ``"Bone Carving"`` (it
contains a space -- don't forget the surrounding quotes!) to indicate the bone
carving labor.

Likewise, for the ``min_skill`` and ``max_skill`` properties, you can specify
either the skill rating ID or the readable caption string. You can see both
options by running::

:lua for idx,name in ipairs(df.skill_rating) do cap=df.skill_rating.attrs[idx].caption if cap then print(('%22s %25s'):format(name, cap)) end end

================= ============================= ==========
Symbol Type Properties
Expand Down
10 changes: 10 additions & 0 deletions plugins/lua/orders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,16 @@ local FURNACE_LABORS = {
[df.furnace_type.MagmaKiln]={'SMELT', 'POTTERY', 'GLAZING'},
}

-- used by quickfort
function get_profile_labors(bld_type, bld_subtype)
if bld_type == df.building_type.Workshop then
return WORKSHOP_LABORS[bld_subtype] or {}
elseif bld_type == df.building_type.Furnace then
return FURNACE_LABORS[bld_subtype] or {}
end
return {}
end

local ENABLED_PEN_LEFT = dfhack.pen.parse{fg=COLOR_CYAN,
tile=curry(textures.tp_control_panel, 1), ch=string.byte('[')}
local ENABLED_PEN_CENTER = dfhack.pen.parse{fg=COLOR_LIGHTGREEN,
Expand Down

0 comments on commit 36cb8eb

Please sign in to comment.