update dig-now docs

develop
myk002 2022-07-22 17:46:33 -07:00
parent 675f2edee2
commit 4cb57d25f1
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 28 additions and 68 deletions

@ -1,10 +1,15 @@
dig-now
=======
Instantly completes non-marker dig designations, modifying tile shapes and
creating boulders, ores, and gems as if a miner were doing the mining or
engraving. By default, the entire map is processed and boulder generation
follows standard game rules, but the behavior is configurable.
Tags:
:dfhack-keybind:`dig-now`
:index:`Instantly complete dig designations.
<dig-now; Instantly complete dig designations.>` This tool will magically
complete non-marker dig designations, modifying tile shapes and creating
boulders, ores, and gems as if a miner were doing the mining or engraving. By
default, the entire map is processed and boulder generation follows standard
game rules, but the behavior is configurable.
Note that no units will get mining or engraving experience for the dug/engraved
tiles.
@ -25,37 +30,34 @@ that coordinate is processed.
Any ``<pos>`` parameters can either be an ``<x>,<y>,<z>`` triple (e.g.
``35,12,150``) or the string ``here``, which means the position of the active
game cursor should be used.
game cursor should be used. You can use the `position` command to get the
current cursor position if you need it.
Examples:
``dig-now``
- ``dig-now``
Dig designated tiles according to standard game rules.
``dig-now --clean``
Dig designated tiles, but don't generate any boulders, ores, or gems.
``dig-now --dump here``
Dig tiles and dump all generated boulders, ores, and gems at the tile under
the game cursor.
- ``dig-now --clean``
Dig all designated tiles, but don't generate any boulders, ores, or gems.
- ``dig-now --dump here``
Dig tiles and teleport all generated boulders, ores, and gems to the tile
under the game cursor.
Options:
:``-c``, ``--clean``:
- ``-c``, ``--clean``
Don't generate any boulders, ores, or gems. Equivalent to
``--percentages 0,0,0,0``.
:``-d``, ``--dump <pos>``:
- ``-d``, ``--dump <pos>``
Dump any generated items at the specified coordinates. If the tile at those
coordinates is open space or is a wall, items will be generated on the
closest walkable tile below.
:``-e``, ``--everywhere``:
- ``-e``, ``--everywhere``
Generate a boulder, ore, or gem for every tile that can produce one.
Equivalent to ``--percentages 100,100,100,100``.
:``-h``, ``--help``:
Show quick usage help text.
:``-p``, ``--percentages <layer>,<vein>,<small cluster>,<deep>``:
- ``-p``, ``--percentages <layer>,<vein>,<small cluster>,<deep>``
Set item generation percentages for each of the tile categories. The
``vein`` category includes both the large oval clusters and the long stringy
mineral veins. Default is ``25,33,100,100``.
:``-z``, ``--cur-zlevel``:
- ``-z``, ``--cur-zlevel``
Restricts the bounds to the currently visible z-level.

@ -838,17 +838,6 @@ static bool get_options(color_ostream &out,
return true;
}
static void print_help(color_ostream &out) {
auto L = Lua::Core::State;
Lua::StackUnwinder top(L);
if (!lua_checkstack(L, 1) ||
!Lua::PushModulePublic(out, L, "plugins.dig-now", "print_help") ||
!Lua::SafeCall(out, L, 0, 0)) {
out.printerr("Failed to load dig-now Lua code\n");
}
}
bool dig_now_impl(color_ostream &out, const dig_now_options &options) {
if (!Maps::IsValid()) {
out.printerr("Map is not available!\n");
@ -880,18 +869,18 @@ command_result dig_now(color_ostream &out, std::vector<std::string> &params) {
dig_now_options options;
if (!get_options(out, options, params) || options.help)
{
print_help(out);
return options.help ? CR_OK : CR_FAILURE;
}
return CR_WRONG_USAGE;
return dig_now_impl(out, options) ? CR_OK : CR_FAILURE;
}
DFhackCExport command_result plugin_init(color_ostream &,
std::vector<PluginCommand> &commands) {
commands.push_back(PluginCommand(
"dig-now", "Instantly complete dig designations", dig_now, false));
commands.push_back(
PluginCommand(
"dig-now",
"Instantly complete dig designations.",
dig_now));
return CR_OK;
}

@ -4,37 +4,6 @@ local argparse = require('argparse')
local guidm = require('gui.dwarfmode')
local utils = require('utils')
local short_help_text = [=[
dig-now
=======
Instantly completes dig designations, modifying map tiles and creating boulders,
ores, and gems as if a miner were doing the mining or engraving. By default, all
dig designations on the map are completed and boulder generation follows
standard game rules, but the behavior is configurable.
Usage:
dig-now [<pos> [<pos>]] [<options>]
Examples:
dig-now
Dig all designated tiles according to standard game rules.
dig-now --clean
Dig designated tiles, but don't generate any boulders, ores, or gems.
dig-now --dump here
Dig tiles and dump all generated boulders, ores, and gems at the tile under
the game cursor.
See the online DFHack documentation for details on all options.
]=]
function print_help() print(short_help_text) end
local function parse_coords(opts, configname, arg)
local cursor = argparse.coords(arg, configname)
utils.assign(opts[configname], cursor)