update docs for diggingInvaders

develop
myk002 2022-07-24 20:12:04 -07:00
parent 60b599865c
commit b2ca3cb194
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 60 additions and 48 deletions

@ -1,28 +1,59 @@
diggingInvaders
===============
Makes invaders dig or destroy constructions to get to your dwarves.
To enable/disable the pluging, use: ``diggingInvaders (1|enable)|(0|disable)``
Basic usage:
:add GOBLIN: registers the race GOBLIN as a digging invader. Case-sensitive.
:remove GOBLIN: unregisters the race GOBLIN as a digging invader. Case-sensitive.
:now: makes invaders try to dig now, if plugin is enabled
:clear: clears all digging invader races
:edgesPerTick n: makes the pathfinding algorithm work on at most n edges per tick.
Set to 0 or lower to make it unlimited.
You can also use ``diggingInvaders setCost (race) (action) n`` to set the
pathing cost of particular action, or ``setDelay`` to set how long it takes.
Costs and delays are per-tile, and the table shows default values.
============================== ======= ====== =================================
Action Cost Delay Notes
============================== ======= ====== =================================
``walk`` 1 0 base cost in the path algorithm
``destroyBuilding`` 2 1,000 delay adds to the job_completion_timer of destroy building jobs that are assigned to invaders
``dig`` 10,000 1,000 digging soil or natural stone
``destroyRoughConstruction`` 1,000 1,000 constructions made from boulders
``destroySmoothConstruction`` 100 100 constructions made from blocks or bars
============================== ======= ====== =================================
Tags:
:dfhack-keybind:`diggingInvaders`
:index:`Invaders dig and destroy to get to your dwarves.
<diggingInvaders; Invaders dig and destroy to get to your dwarves.>`
Usage:
``enable diggingInvaders``
Enable the plugin.
``diggingInvaders add <race>``
Register the specified race as a digging invader.
``diggingInvaders remove <race>``
Unregisters the specified race as a digging invader.
``diggingInvaders now``
Makes invaders try to dig now (if the plugin is enabled).
``diggingInvaders clear``
Clears the registry of digging invader races.
``diggingInvaders edgesPerTick <n>``
Makes the pathfinding algorithm work on at most n edges per tick. Set to 0
or lower to make it unlimited.
``diggingInvaders setCost <race> <action> <n>``
Set the pathing cost per tile for a particular action. This determines what
invaders consider to be the shortest path to their target.
``diggingInvaders setDelay <race> <action> <n>``
Set the time cost (in ticks) for performing a particular action. This
determines how long it takes for invaders to get to their target.
Note that the race is case-sensitive. You can get a list of races for your world
with this command::
devel/query --table df.global.world.raws.creatures.all --search creature_id --maxdepth 1 --maxlength 5000
but in general, the race is what you'd expect, just capitalized (e.g. ``GOBLIN``
or ``ELF``).
Actions:
``walk``
Default cost: 1, default delay: 0. This is the base cost for the pathing
algorithm.
``destroyBuilding``
Default cost: 2, default delay: 1,000,
``dig``
Default cost: 10,000, default delay: 1,000. This is for digging soil or
natural stone.
``destroyRoughConstruction``
Default cost: 1,000, default delay: 1,000. This is for destroying
constructions made from boulders.
``destroySmoothConstruction``
Default cost: 100, default delay: 100. This is for destroying constructions
made from blocks or bars.
Example
-------
``diggingInvaders add GOBLIN``
Registers members of the GOBLIN race as a digging invader.

@ -120,28 +120,9 @@ static int32_t jobDelayDefault[] = {
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{
commands.push_back(PluginCommand(
"diggingInvaders", "Makes invaders dig to your dwarves.",
diggingInvadersCommand, false, /* true means that the command can't be used from non-interactive user interface */
" diggingInvaders 0\n disables the plugin\n"
" diggingInvaders 1\n enables the plugin\n"
" diggingInvaders enable\n enables the plugin\n"
" diggingInvaders disable\n disables the plugin\n"
" diggingInvaders add GOBLIN\n registers the race GOBLIN as a digging invader. Case-sensitive.\n"
" diggingInvaders remove GOBLIN\n unregisters the race GOBLIN as a digging invader. Case-sensitive.\n"
" diggingInvaders setCost GOBLIN walk n\n sets the walk cost in the path algorithm for the race GOBLIN\n"
" diggingInvaders setCost GOBLIN destroyBuilding n\n"
" diggingInvaders setCost GOBLIN dig n\n"
" diggingInvaders setCost GOBLIN destroyRoughConstruction n\n rough constructions are made from boulders\n"
" diggingInvaders setCost GOBLIN destroySmoothConstruction n\n smooth constructions are made from blocks or bars instead of boulders\n"
" diggingInvaders setDelay GOBLIN destroyBuilding n\n adds to the job_completion_timer of destroy building jobs that are assigned to invaders\n"
" diggingInvaders setDelay GOBLIN dig n\n"
" diggingInvaders setDelay GOBLIN destroyRoughConstruction n\n"
" diggingInvaders setDelay GOBLIN destroySmoothConstruction n\n"
" diggingInvaders now\n makes invaders try to dig now, if plugin is enabled\n"
" diggingInvaders clear\n clears all digging invader races\n"
" diggingInvaders edgesPerTick n\n makes the pathfinding algorithm work on at most n edges per tick. Set to 0 or lower to make it unlimited."
// " diggingInvaders\n Makes invaders try to dig now.\n"
));
"diggingInvaders",
"Makes invaders dig to your dwarves.",
diggingInvadersCommand));
//*df::global::debug_showambush = true;
return CR_OK;