diff --git a/docs/plugins/plants.rst b/docs/plugins/plants.rst index 0111b0770..4fc87f353 100644 --- a/docs/plugins/plants.rst +++ b/docs/plugins/plants.rst @@ -1,18 +1,28 @@ .. _plant: -plant -===== -A tool for creating shrubs, growing, or getting rid of them. +plants +====== +Tags: +:dfhack-keybind:`plant` -Subcommands: +Grow shrubs or trees. -:create: Creates a new sapling under the cursor. Takes a raw ID as argument - (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. +Usage: -For mass effects, use one of the additional options: +``plant create `` + 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 -:trees: affect all trees on the map -:all: affect every plant! +To see the full list of plant ids, run the following command:: + + 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. diff --git a/plugins/plants.cpp b/plugins/plants.cpp index 69e712ef8..2325c01e3 100644 --- a/plugins/plants.cpp +++ b/plugins/plants.cpp @@ -32,10 +32,7 @@ command_result df_grow (color_ostream &out, vector & parameters) { if(parameters[i] == "help" || parameters[i] == "?") { - out.print("Usage:\n" - "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; + return CR_WRONG_USAGE; } } @@ -91,11 +88,7 @@ command_result df_createplant (color_ostream &out, vector & parameters) { if ((parameters.size() != 1) || (parameters[0] == "help" || parameters[0] == "?")) { - out.print("Usage:\n" - "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; + return CR_WRONG_USAGE; } CoreSuspender suspend; @@ -201,10 +194,10 @@ command_result df_plant (color_ostream &out, vector & parameters) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { - commands.push_back(PluginCommand("plant", "Plant creation and removal.", df_plant, false, - "Command to create, grow or remove plants on the map. For more details, check the subcommand help :\n" - "plant grow help - Grows saplings into trees.\n" - "plant create help - Create a new plant.\n")); + commands.push_back(PluginCommand( + "plant", + "Grow shrubs or trees.", + df_plant)); return CR_OK; }