Skip to content

Commit

Permalink
Merge branch 'develop' into adv-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Sep 28, 2024
2 parents 05c0e55 + ca01706 commit de8e955
Show file tree
Hide file tree
Showing 39 changed files with 3,730 additions and 3,377 deletions.
95 changes: 61 additions & 34 deletions data/blueprints/aquifer_tap.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,79 @@ Here's the procedure:
""
2) Dig a one-tile-wide tunnel from where you want the water to end up (e.g. your well cistern) to an area on the same z-level directly below the target light aquifer. Dig a one-tile-wide diagonal segment in this tunnel near the cistern side so water that will eventually flow through the tunnel is depressurized.
""
"3) From the end of that tunnel, go down one z-level, enable damp dig mode in the dig toolbar, then dig a staircase straight up so that the top is in the lowest aquifer level (a tile with a two-drop icon). Change the top staircase tile (the down-only stairs) to a ""blueprint"" tile (default hotkey: m-L) so your miners don't dig it yet."
"3) Pause the game. From the end of that tunnel, go down one z-level, enable damp dig mode in the dig toolbar, then designate for digging a staircase straight up so that the top is in the lowest aquifer level (a tile with a two-drop icon). If you only have one layer of aquifer, you should end the staircase one level below the aquifer so when we dig the tap, it will extend up into the aquifer level. Your tunnel should connect to the staircase one z-level above the bottom of the staircase."
""
"4) From the bottom of the staircase (the z-level below where the water will flow to your cisterns), dig a straight, one-tile wide tunnel to the closest edge of the map. This is your emergency drainage tunnel. Smooth the map edge tile and carve a fortification. The water can flow through the fortification and off the map, allowing the dwarves to dig out the aquifer tap without drowning."
"4) Apply this blueprint (gui/quickfort aquifer_tap /dig) to the z-level at the top of the staircase. The tiles will be designated in ""damp dig"" mode so your miners can dig it out without the damp tiles canceling the digging designations. This blueprint designates ramps for digging so two layers of aquifer can contribute to the water collector. It also changes the staircase tile below the tap to a ""blueprint"" tile so your miners don't dig the tap before your drainage tunnel is ready."
""
5) Place a lever-controlled floodgate in the drainage tunnel and open the floodgate. Place the lever somewhere else in your fort so that it will remain dry and accessible.
"5) You can now unpause the game. From the bottom of the staircase (the z-level below where the water will flow to your cisterns), dig a straight, one-tile wide tunnel to the closest edge of the map. This is your emergency drainage tunnel. Smooth the map edge tile and carve a fortification. The water can flow through the fortification and off the map, allowing the dwarves to dig out the aquifer tap without drowning."
""
"6) If you want, haul away any boulders in the tunnels and/or smooth the tiles (e.g. mark them for dumping -- hotkey i-p -- and wait for them to be dumped). You won't be able to access any of this area once it fills up with water!"
6) Place a lever-controlled floodgate in the drainage tunnel and open the floodgate. Place the lever somewhere else in your fort so that it will remain dry and accessible.
""
"7) Apply this blueprint (gui/quickfort aquifer_tap /dig) to the z-level above the top of the staircase, inside the lowest aquifer level. The tiles will be designated in ""damp dig"" mode so your miners can dig it out without the damp tiles canceling the digging designations. This blueprint designates ramps for digging so two layers of aquifer can contribute to the water collector."
"7) If you want, haul away any boulders in the tunnels and/or smooth the tiles (e.g. mark them for dumping -- hotkey i-p -- and wait for them to be dumped). Enable prioritize in gui/control-panel to focus dwarves on dumping tasks and make it go faster. You won't be able to access any of this area once it fills up with water!"
""
"8) Dig out the tap. You can haul away any boulders and remove the ramps if you like. The water will safely flow down the staircase, through the open floodgate, down the drainage tunnel, and off the map as long as the floodgate is open."
"8) Convert the ""blueprint"" stairway tile to a regular up/down stair dig designation to allow your miners to dig out the tap. You can haul away any boulders and remove the ramps if you like. There is no rush. The water will safely flow down the staircase, through the open floodgate, down the drainage tunnel, and off the map as long as the floodgate is open."
"8b) Sometimes, DF gets into a bad state with mining designations and miners will refuse to dig the stairway tile. If this happens to you, enter mining mode, enable the keyboard cursor if it's not already enabled (hotkey: Alt-k), highlight the undug stair designation, and run dig-now here in gui/launcher. You might also have to do this for the down stair designation in the center of the aquifer tap. Your miners should be able to handle the rest without assistance."

"9) Once everything is dug out and all dwarves are out of the waterways, close the floodgate. Your cisterns will fill with water. Since the waterway to your cisterns is depressurized, the cisterns will stay forever full, but will not flood."
"9) Once everything is dug out and all dwarves are out of the waterways, close the floodgate. Your cisterns will fill with water. Since the waterway to your cisterns is depressurized (due to the diagonal tunnel you dug), the cisterns will stay forever full, but will not flood."
""
A diagram might be useful. Here is a vertical view through the z-levels. This blueprint goes at the top:
""
"j <- down stairs, center of this blueprint"
i
"j <- down stairs, center of this blueprint"
"i <- up/down stairs, initially in ""blueprint mode"" to prevent digging before drainage is ready"
"... <- up/down stairs, make this as tall as you need"
i
i <- cistern outlet level
i <- cistern outlet level with diagonal tunnel to depressurize
"u <- up stairs, drainage level"
""
"Good luck! If done right, this method is the safest way to supply your fort with clean water."
#dig label(dig) start(13 13 center of tap) light aquifer water collector

,,,,,,,,,,,,mdr
,,,,,,,,,,,,mdr
,,,,,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr
,,,,,,,,,,,,mdr
,,,mdr,,,,,,,,,mdr,,,,,,,,,mdr
,,,mdr,,,,,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,,,,,mdr
,,,mdr,,,,,,,,,mdr,,,,,,,,,mdr
,,,mdr,,,mdr,,,,,,mdr,,,,,,mdr,,,mdr
,,,mdr,,,mdr,,,,,mdr,mdr,mdr,,,,,mdr,,,mdr
,,,mdr,,,mdr,,,,,,mdr,,,,,,mdr,,,mdr
,,,mdr,,,mdr,,,mdr,,,mdr,,,mdr,,,mdr,,,mdr
,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdj,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr
,,,mdr,,,mdr,,,mdr,,,mdr,,,mdr,,,mdr,,,mdr
,,,mdr,,,mdr,,,,,,mdr,,,,,,mdr,,,mdr
,,,mdr,,,mdr,,,,,mdr,mdr,mdr,,,,,mdr,,,mdr
,,,mdr,,,mdr,,,,,,mdr,,,,,,mdr,,,mdr
,,,mdr,,,,,,,,,mdr,,,,,,,,,mdr
,,,mdr,,,,,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,mdr,,,,,mdr
,,,mdr,,,,,,,,,mdr,,,,,,,,,m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,,,
,,,,,,,,,,,,`,,,,,,,,,,,,
8 changes: 8 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,28 @@ Template for new versions:
## New Tools

## New Features
- `tweak`: ``realistic-melting``: change melting return for inorganic armor parts, shields, weapons, trap components and tools to stop smelters from creating metal, bring melt return for adamantine in line with other metals to ~95% of forging cost. wear reduces melt return by 10% per level

## Fixes

## Misc Improvements
- DFHack text edit fields now delete the character at the cursor when you hit the Delete key
- DFHack text edit fields now move the cursor by one word left or right with Ctrl-Left and Ctrl-Right
- DFHack text edit fields now move the cursor to the beginning or end of the line with Home and End
- Quickfort blueprint library: ``aquifer_tap`` blueprint walkthough rewritten for clarity
- Quickfort blueprint library: ``aquifer_tap`` blueprint now designated at priority 3 and marks the stairway tile below the tap in "blueprint" mode to prevent drips while the drainage pipe is being prepared
- `preserve-rooms`: automatically release room reservations for captured squad members. we were kidding ourselves with our optimistic kept reservations. they're unlikely to come back : ((

## Documentation

## API

- ``DFHack::Units``: new function ``setPathGoal``

## Lua

- ``dfhack.units``: new function ``setPathGoal``

## Removed

# 50.14-r1
Expand Down
5 changes: 5 additions & 0 deletions docs/dev/Lua API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,11 @@ Units module
``dfhack.units.isOwnCiv`` or another appropriate predicate on the unit
in question.

* ``dfhack.units.setPathGoal(unit, pos, goal)``

Set target coordinates and goal (of type ``df.unit_path_goal``) for the given
unit. In case of a change, also clears the unit's current path.

* ``dfhack.units.create(race, caste)``

Creates a new unit from scratch. The unit will be added to the
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/compile/Dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ Here are some package install commands for various distributions:

* On Arch Linux::

pacman -Sy gcc cmake ccmake ninja git dwarffortress zlib perl-xml-libxml perl-xml-libxslt
pacman -Sy gcc cmake ccache ninja git dwarffortress zlib perl-xml-libxml perl-xml-libxslt

* The ``dwarffortress`` package provides the necessary SDL packages.
* For the required Perl modules: ``perl-xml-libxml`` and ``perl-xml-libxslt`` (or through ``cpan``)

* On Ubuntu::

apt-get install gcc cmake ninja-build git zlib1g-dev libsdl2-dev libxml-libxml-perl libxml-libxslt-perl
apt-get install gcc cmake ccache ninja-build git zlib1g-dev libsdl2-dev libxml-libxml-perl libxml-libxslt-perl

* Other Debian-based distributions should have similar requirements.

* On Fedora::

yum install gcc-c++ cmake ninja-build git zlib-devel SDL2-devel perl-core perl-XML-LibXML perl-XML-LibXSLT ruby
yum install gcc-c++ cmake ccache ninja-build git zlib-devel SDL2-devel perl-core perl-XML-LibXML perl-XML-LibXSLT ruby

To build DFHack, you need GCC 10 or newer. Note that extremely new GCC versions
may not have been used to build DFHack yet, so if you run into issues with
Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/dwarfvet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ unassigned from the pasture while in treatment. The animal will be reassigned
to its original pasture shortly after recovery.

Animals that are on restraints or in cages will not be designated for treatment.
Animals require an empty tile of floor to rest on while recovering, so your
hospital must have some unoccupied floor space in order for animals to use it.

You can enable ``dwarfvet`` in `gui/control-panel`, and you can choose to start
``dwarfvet`` automatically in new forts in the ``Gameplay`` -> ``Autostart``
Expand Down
5 changes: 2 additions & 3 deletions docs/plugins/preserve-rooms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ This tool mitigates both issues. It records when units leave the map and
reserves their assigned bedrooms, offices, etc. for them. The zones will be
disabled in their absence (so other units don't steal them), and will be
re-enabled and reassigned to them when they appear back on the map. If they die
away from the fort, the zone will become unreserved and available for reuse. If
they are captured and held prisoner, their room will continue to be reserved in
their name in the (optimistic) hope of their safe return.
away from the fort (or are captured), the zone will become unreserved and
available for reuse.

When you click on an assignable zone, you will also now have the option to
associate the room with a noble or administrative role. The room will be
Expand Down
13 changes: 13 additions & 0 deletions docs/plugins/tweak.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ Commands
Names filled waterskins, flasks, and vials according to their contents,
the same way other containers such as barrels, bins, and cages are named.
(:bug:`4914`)
``realistic-melting``
Makes amortized metal bar returns for melting uniform across all item types.
Affects weapons, shields, armor parts, tools, and trap components. The target
amount of metal produced by melting is 95% of the metal used for production
of the item. Each level of wear decreases melt return by a further 10%. The game
has a fixed granularity of 0.3 for metal bar returns, so individual items will
randomly return an amount that may be above or below the target. For example
a metal cap with item size 1 will produce 0.9 of a bar with a 16.6% chance of
producing an additional 0.3 of a bar. Over time, the average return for melting
these types of caps will be ~0.95 of a bar. Calculations for melting return are
done for items with base game production cost. Melting return might not be
calculated correctly for modded items or items created in custom reactions
that don't respect vanilla production costs. (:bug:`6027`)
``named-codices``
Displays titles for books instead of the default material description.
``partial-items``
Expand Down
1 change: 1 addition & 0 deletions library/LuaApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,6 +2065,7 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = {
WRAPM(Units, getIdentity),
WRAPM(Units, getNemesis),
WRAPM(Units, makeown),
WRAPM(Units, setPathGoal),
WRAPM(Units, create),
WRAPM(Units, getPhysicalAttrValue),
WRAPM(Units, getMentalAttrValue),
Expand Down
4 changes: 4 additions & 0 deletions library/include/modules/Units.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ distribution.
#include "df/physical_attribute_type.h"
#include "df/unit_action.h"
#include "df/unit_action_type_group.h"
#include "df/unit_path_goal.h"

#include <ranges>

Expand Down Expand Up @@ -238,6 +239,9 @@ DFHACK_EXPORT bool unassignTrainer(df::unit *unit);
/// to determine if the makeown operation was successful.
DFHACK_EXPORT void makeown(df::unit *unit);

// Set the units target location and goal, clearing any existing goal or path
DFHACK_EXPORT void setPathGoal(df::unit *unit, df::coord pos, df::unit_path_goal goal);

/// Create new unit and add to all units vector (but not active). No HF, nemesis, pos,
/// labors, or group associations. Will have race, caste, name, soul, body, and mind.
DFHACK_EXPORT df::unit *create(int16_t race, int16_t caste);
Expand Down
Loading

0 comments on commit de8e955

Please sign in to comment.