update docs for plants

n.b. original docs were a lie.
develop
myk002 2022-07-28 22:51:17 -07:00
parent 2e2abbe87a
commit 2d400fb571
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 28 additions and 25 deletions

@ -1,18 +1,28 @@
.. _plant: .. _plant:
plant plants
===== ======
A tool for creating shrubs, growing, or getting rid of them. Tags:
:dfhack-keybind:`plant`
Subcommands: Grow shrubs or trees.
:create: Creates a new sapling under the cursor. Takes a raw ID as argument Usage:
(e.g. TOWER_CAP). The cursor must be located on a dirt or grass floor tile.
:grow: Turns saplings into trees; under the cursor if a sapling is selected,
or every sapling on the map if the cursor is hidden.
For mass effects, use one of the additional options: ``plant create <ID>``
Creates a new plant of the specified type at the active cursor position.
The cursor must be on a dirt or grass floor tile.
``plant grow``
Grows saplings into trees. If the cursor is active, it only affects the
sapling under the cursor. If no cursor is active, it affect all saplings
on the map.
:shrubs: affect all shrubs on the map To see the full list of plant ids, run the following command::
:trees: affect all trees on the map
:all: affect every plant! devel/query --table df.global.world.raws.plants.all --search ^id --maxdepth 1
Example
-------
``plant create TOWER_CAP``
Create a Tower Cap sapling at the cursor position.

@ -32,10 +32,7 @@ command_result df_grow (color_ostream &out, vector <string> & parameters)
{ {
if(parameters[i] == "help" || parameters[i] == "?") if(parameters[i] == "help" || parameters[i] == "?")
{ {
out.print("Usage:\n" return CR_WRONG_USAGE;
"This command turns all living saplings on the map into full-grown trees.\n"
"With active cursor, work on the targetted one only.\n");
return CR_OK;
} }
} }
@ -91,11 +88,7 @@ command_result df_createplant (color_ostream &out, vector <string> & parameters)
{ {
if ((parameters.size() != 1) || (parameters[0] == "help" || parameters[0] == "?")) if ((parameters.size() != 1) || (parameters[0] == "help" || parameters[0] == "?"))
{ {
out.print("Usage:\n" return CR_WRONG_USAGE;
"Create a new plant at the cursor.\n"
"Specify the type of plant to create by its raw ID (e.g. TOWER_CAP or MUSHROOM_HELMET_PLUMP).\n"
"Only shrubs and saplings can be placed, and they must be located on a dirt or grass floor.\n");
return CR_OK;
} }
CoreSuspender suspend; CoreSuspender suspend;
@ -201,10 +194,10 @@ command_result df_plant (color_ostream &out, vector <string> & parameters)
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.push_back(PluginCommand("plant", "Plant creation and removal.", df_plant, false, commands.push_back(PluginCommand(
"Command to create, grow or remove plants on the map. For more details, check the subcommand help :\n" "plant",
"plant grow help - Grows saplings into trees.\n" "Grow shrubs or trees.",
"plant create help - Create a new plant.\n")); df_plant));
return CR_OK; return CR_OK;
} }