Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b2ca3cb

Browse files
committed
update docs for diggingInvaders
1 parent 60b5998 commit b2ca3cb

2 files changed

Lines changed: 60 additions & 48 deletions

File tree

docs/plugins/diggingInvaders.rst

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,59 @@
11
diggingInvaders
22
===============
3-
Makes invaders dig or destroy constructions to get to your dwarves.
4-
5-
To enable/disable the pluging, use: ``diggingInvaders (1|enable)|(0|disable)``
6-
7-
Basic usage:
8-
9-
:add GOBLIN: registers the race GOBLIN as a digging invader. Case-sensitive.
10-
:remove GOBLIN: unregisters the race GOBLIN as a digging invader. Case-sensitive.
11-
:now: makes invaders try to dig now, if plugin is enabled
12-
:clear: clears all digging invader races
13-
:edgesPerTick n: makes the pathfinding algorithm work on at most n edges per tick.
14-
Set to 0 or lower to make it unlimited.
15-
16-
You can also use ``diggingInvaders setCost (race) (action) n`` to set the
17-
pathing cost of particular action, or ``setDelay`` to set how long it takes.
18-
Costs and delays are per-tile, and the table shows default values.
19-
20-
============================== ======= ====== =================================
21-
Action Cost Delay Notes
22-
============================== ======= ====== =================================
23-
``walk`` 1 0 base cost in the path algorithm
24-
``destroyBuilding`` 2 1,000 delay adds to the job_completion_timer of destroy building jobs that are assigned to invaders
25-
``dig`` 10,000 1,000 digging soil or natural stone
26-
``destroyRoughConstruction`` 1,000 1,000 constructions made from boulders
27-
``destroySmoothConstruction`` 100 100 constructions made from blocks or bars
28-
============================== ======= ====== =================================
3+
Tags:
4+
:dfhack-keybind:`diggingInvaders`
5+
6+
:index:`Invaders dig and destroy to get to your dwarves.
7+
<diggingInvaders; Invaders dig and destroy to get to your dwarves.>`
8+
9+
Usage:
10+
11+
``enable diggingInvaders``
12+
Enable the plugin.
13+
``diggingInvaders add <race>``
14+
Register the specified race as a digging invader.
15+
``diggingInvaders remove <race>``
16+
Unregisters the specified race as a digging invader.
17+
``diggingInvaders now``
18+
Makes invaders try to dig now (if the plugin is enabled).
19+
``diggingInvaders clear``
20+
Clears the registry of digging invader races.
21+
``diggingInvaders edgesPerTick <n>``
22+
Makes the pathfinding algorithm work on at most n edges per tick. Set to 0
23+
or lower to make it unlimited.
24+
``diggingInvaders setCost <race> <action> <n>``
25+
Set the pathing cost per tile for a particular action. This determines what
26+
invaders consider to be the shortest path to their target.
27+
``diggingInvaders setDelay <race> <action> <n>``
28+
Set the time cost (in ticks) for performing a particular action. This
29+
determines how long it takes for invaders to get to their target.
30+
31+
Note that the race is case-sensitive. You can get a list of races for your world
32+
with this command::
33+
34+
devel/query --table df.global.world.raws.creatures.all --search creature_id --maxdepth 1 --maxlength 5000
35+
36+
but in general, the race is what you'd expect, just capitalized (e.g. ``GOBLIN``
37+
or ``ELF``).
38+
39+
Actions:
40+
``walk``
41+
Default cost: 1, default delay: 0. This is the base cost for the pathing
42+
algorithm.
43+
``destroyBuilding``
44+
Default cost: 2, default delay: 1,000,
45+
``dig``
46+
Default cost: 10,000, default delay: 1,000. This is for digging soil or
47+
natural stone.
48+
``destroyRoughConstruction``
49+
Default cost: 1,000, default delay: 1,000. This is for destroying
50+
constructions made from boulders.
51+
``destroySmoothConstruction``
52+
Default cost: 100, default delay: 100. This is for destroying constructions
53+
made from blocks or bars.
54+
55+
Example
56+
-------
57+
58+
``diggingInvaders add GOBLIN``
59+
Registers members of the GOBLIN race as a digging invader.

plugins/diggingInvaders/diggingInvaders.cpp

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,28 +120,9 @@ static int32_t jobDelayDefault[] = {
120120
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
121121
{
122122
commands.push_back(PluginCommand(
123-
"diggingInvaders", "Makes invaders dig to your dwarves.",
124-
diggingInvadersCommand, false, /* true means that the command can't be used from non-interactive user interface */
125-
" diggingInvaders 0\n disables the plugin\n"
126-
" diggingInvaders 1\n enables the plugin\n"
127-
" diggingInvaders enable\n enables the plugin\n"
128-
" diggingInvaders disable\n disables the plugin\n"
129-
" diggingInvaders add GOBLIN\n registers the race GOBLIN as a digging invader. Case-sensitive.\n"
130-
" diggingInvaders remove GOBLIN\n unregisters the race GOBLIN as a digging invader. Case-sensitive.\n"
131-
" diggingInvaders setCost GOBLIN walk n\n sets the walk cost in the path algorithm for the race GOBLIN\n"
132-
" diggingInvaders setCost GOBLIN destroyBuilding n\n"
133-
" diggingInvaders setCost GOBLIN dig n\n"
134-
" diggingInvaders setCost GOBLIN destroyRoughConstruction n\n rough constructions are made from boulders\n"
135-
" diggingInvaders setCost GOBLIN destroySmoothConstruction n\n smooth constructions are made from blocks or bars instead of boulders\n"
136-
" diggingInvaders setDelay GOBLIN destroyBuilding n\n adds to the job_completion_timer of destroy building jobs that are assigned to invaders\n"
137-
" diggingInvaders setDelay GOBLIN dig n\n"
138-
" diggingInvaders setDelay GOBLIN destroyRoughConstruction n\n"
139-
" diggingInvaders setDelay GOBLIN destroySmoothConstruction n\n"
140-
" diggingInvaders now\n makes invaders try to dig now, if plugin is enabled\n"
141-
" diggingInvaders clear\n clears all digging invader races\n"
142-
" 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."
143-
// " diggingInvaders\n Makes invaders try to dig now.\n"
144-
));
123+
"diggingInvaders",
124+
"Makes invaders dig to your dwarves.",
125+
diggingInvadersCommand));
145126

146127
//*df::global::debug_showambush = true;
147128
return CR_OK;

0 commit comments

Comments
 (0)