Skip to content

Commit 2f285b0

Browse files
authored
Merge pull request #1415 from Bumber64/adv-finder
Create `gui/adv-finder`
2 parents a91c23c + 3c2420f commit 2f285b0

File tree

5 files changed

+888
-2
lines changed

5 files changed

+888
-2
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Template for new versions:
2727
# Future
2828

2929
## New Tools
30+
- `gui/adv-finder`: UI for tracking historical figures and artifacts in adventure mode
3031

3132
## New Features
3233

docs/gui/adv-finder.rst

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
gui/adv-finder
2+
==============
3+
4+
.. dfhack-tool::
5+
:summary: Find and track historical figures and artifacts
6+
:tags: adventure armok inspection items units
7+
8+
A real-time tracker for historical figures and artifacts. Select a target by
9+
clicking the settings icon [☼] and selecting an entry from the list in the
10+
relevant tab. The list can be filtered by search string, as well as by
11+
excluding dead figures (displayed in red text). Artifacts can exclude books,
12+
and the "dead" option excludes artifacts held by dead figures (which are
13+
generally unrecoverable). Dismissing the screen (e.g., right-click) will
14+
close the target search window first. A second dismissal will close the
15+
finder window, but target settings will be preserved until the world is
16+
unloaded.
17+
18+
Your coordinates will be kept up to date alongside your target's. There are
19+
two types of coordinates, and they will be displayed as long as they can be
20+
determined.
21+
22+
========== ==========
23+
Coord Type Meaning
24+
========== ==========
25+
Global Distance in map blocks from the world origin (northwest corner).
26+
The adventurer usually moves by 3 blocks during fast travel, but
27+
slows to 1 when the zoomed site map is displayed. Equivalent to
28+
16 local tiles. Always available except for targets with an
29+
indeterminate location.
30+
Local Tile coordinates, available outside of fast travel and sleeping.
31+
Your target's local coordinates are displayed when nearby and
32+
loaded. Local coordinates will remain consistent within a site, but
33+
may jump around in the wilderness as areas of the world are loaded.
34+
========== ==========
35+
36+
For global coordinates, the Z component will only be displayed if it can be
37+
specifically determined by the location type. This represents an underground
38+
layer depth, so the surface is indicated by ``Z0`` and the first cavern layer
39+
is ``Z-1``.
40+
41+
A compass and relative coordinates will be displayed. The relative coordinate
42+
display uses the most precise coordinate type shared between you and your
43+
target.
44+
45+
There are six types of location types displayed for targets:
46+
47+
============= ==========
48+
Location Type Meaning
49+
============= ==========
50+
Nearby The target is loaded into the map area and the local
51+
coordinates will be displayed. If you don't see this when you're
52+
in the correct area and outside fast travel, then the target
53+
isn't loading for some reason and you'll never be able to find
54+
them.
55+
Site The target is located within a site. The text displays
56+
"At <Sitename>" and the global coords will represent the center
57+
of the site if the target doesn't track its own precise
58+
coordinates (e.g., worldgen being vague).
59+
Traveling The target is traveling around the world map like an army.
60+
Wilderness The target is somewhere on the surface not in a site.
61+
Underground The target is somewhere in the caverns not in a site.
62+
None The target's location isn't defined in the game world.
63+
Maybe they're a deity. Maybe they got dropped off in limbo
64+
after their army disbanded. If they're dead, the location
65+
wasn't recorded properly in history. The text displays "Missing"
66+
if they're dead or can die of old age, else "Transcendent"
67+
because nothing can touch them.
68+
============= ==========
69+
70+
Dead figures generally can't be encountered at all, and they take their items
71+
with them if they weren't separated properly by worldgen. The coord given is
72+
usually a death or abstract burial location, but the corpse isn't guaranteed to
73+
exist. Generally, wilderness and underground locations only have coords if you
74+
left something there in adventure mode. Anything lost there during worldgen or a
75+
fort mode mission likely can't be located. Anything in a site is usually a safe
76+
bet, but sometimes items won't load. (Fort missions can be used to acquire these
77+
for later retrieval, however.) Traveling targets are always valid.
78+
79+
Usage
80+
-----
81+
82+
::
83+
84+
gui/adv-finder [<options>]
85+
86+
Examples
87+
--------
88+
89+
``gui/adv-finder``
90+
Open the finder window (unless already open). Target will be blank on first
91+
use, but maintained on future invocations.
92+
``gui/adv-finder --histfig 1234``
93+
Track the historical figure with ID #1234. Finder will be opened if not
94+
already.
95+
``gui/adv-finder -h -1 -a -1``
96+
Clear any target so it's just the adventurer. Finder will be opened if not
97+
already.
98+
``gui/adv-finder --debug``
99+
Display selected target IDs in the finder window title bar. Finder will be
100+
opened if not already. This setting isn't saved, so it can be disabled by
101+
invoking ``gui/adv-finder`` again without the option.
102+
103+
Options
104+
-------
105+
106+
``-h``, ``--histfig <id>``
107+
Set the target to the historical figure with the given ID.
108+
``-a``, ``--artifact <id>``
109+
Set the target to the artifact record with the given ID. (Not an item ID!)
110+
``-d``, ``--debug``
111+
Display selected target IDs in the finder window title bar. Doesn't persist
112+
between invocations.

docs/gui/aquifer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tiles or warm tiles). Note that "just damp" tiles will still be highlighted if
1212
they are otherwise already visible.
1313

1414
You can draw boxes around areas of tiles to alter their aquifer properties, or
15-
you can use the :kbd:`Ctrl`:kbd:`A`` shortcut to affect entire layers at a time.
15+
you can use the :kbd:`Ctrl`:kbd:`A` shortcut to affect entire layers at a time.
1616

1717
If you want to see where the aquifer tiles are so you can designate digging,
1818
please run `gui/reveal`. If you only want to see the aquifer tiles and not

fix/stuckdoors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end
99

1010
-- Util function: find out if there are any units on the tile with coordinates x,y,z
1111
function unitOnTile(x, y, z)
12-
local units = dfhack.units.getUnitsInBox(x,y,z,x,y,z,dfhack.units.isActive)
12+
local units = dfhack.units.getUnitsInBox(x,y,z,x,y,z)
1313
return #(units) > 0
1414
end
1515

0 commit comments

Comments
 (0)