update docs for changelayer

develop
myk002 2022-07-20 13:21:05 -07:00
parent ddd2e5003a
commit fae5f0635a
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 63 additions and 109 deletions

@ -1,60 +1,72 @@
changelayer changelayer
=========== ===========
Changes material of the geology layer under cursor to the specified inorganic
RAW material. Can have impact on all surrounding regions, not only your embark! Tags:
By default changing stone to soil and vice versa is not allowed. By default :dfhack-keybind:
changes only the layer at the cursor position. Note that one layer can stretch
across lots of z levels. By default changes only the geology which is linked Change the material of an entire geology layer. Note that one layer can stretch
to the biome under the cursor. That geology might be linked to other biomes across many z-levels, and changes to the geology layer will affect all
as well, though. Mineral veins and gem clusters will stay on the map. Use surrounding regions, not just your embark! Mineral veins and gem clusters will
`changevein` for them. not be affected. Use `changevein` if you want to modify those.
tl;dr: You will end up with changing quite big areas in one go, especially if tl;dr: You will end up with changing large areas in one go, especially if you
you use it in lower z levels. Use with care. use it in lower z levels. Use this command with care!
Options: Usage::
:all_biomes: Change selected layer for all biomes on your map. changelayer <material RAW id> [<options>]
Result may be undesirable since the same layer can AND WILL
be on different z-levels for different biomes. Use the tool When run without options, ``changelayer`` will:
'probe' to get an idea how layers and biomes are distributed
on your map. - only affect the geology layer at the current cursor position
:all_layers: Change all layers on your map (only for the selected biome - only affect the biome that covers the current cursor position
unless 'all_biomes' is added). - not allow changing stone to soil and vice versa
Candy mountain, anyone? Will make your map quite boring,
but tidy. You can use the `probe` command on various tiles around your map to find valid
:force: Allow changing stone to soil and vice versa. !!THIS CAN HAVE material RAW ids and to get an idea how layers and biomes are distributed.
WEIRD EFFECTS, USE WITH CARE!!
Note that soil will not be magically replaced with stone. Options
You will, however, get a stone floor after digging so it -------
will allow the floor to be engraved.
Note that stone will not be magically replaced with soil. - ``all_biomes``
You will, however, get a soil floor after digging so it Change the corresponding geology layer for all biomes on your map. Be aware
could be helpful for creating farm plots on maps with no that the same geology layer can AND WILL be on different z-levels for
soil. different biomes.
:verbose: Give some details about what is being changed. - ``all_layers``
:trouble: Give some advice about known problems. Change all geology layers on your map (only for the selected biome unless
``all_biomes`` is also specified). Candy mountain, anyone? Will make your map
Examples: quite boring, but tidy.
- ``force``
Allow changing stone to soil and vice versa. **THIS CAN HAVE WEIRD EFFECTS,
USE WITH CARE AND SAVE FIRST**. Note that soil will not be magically replaced
with stone. You will, however, get a stone floor after digging, so it will
allow the floor to be engraved. Similarly, stone will not be magically
replaced with soil, but you will get a soil floor after digging, so it could
be helpful for creating farm plots on maps with no soil.
- ``verbose``
Output details about what is being changed.
Examples
--------
``changelayer GRANITE`` ``changelayer GRANITE``
Convert layer at cursor position into granite. Convert the layer at the cursor position into granite.
``changelayer SILTY_CLAY force`` ``changelayer SILTY_CLAY force``
Convert layer at cursor position into clay even if it's stone. Convert teh layer at the cursor position into clay, even if it's stone.
``changelayer MARBLE all_biomes all_layers`` ``changelayer MARBLE all_biomes all_layers``
Convert all layers of all biomes which are not soil into marble. Convert all layers of all biomes which are not soil into marble.
.. note:: .. note::
* If you use changelayer and nothing happens, try to pause/unpause the game * If you use changelayer and nothing happens, try to pause/unpause the game
for a while and try to move the cursor to another tile. Then try again. for a while and move the cursor to another tile. Then try again. If that
If that doesn't help try temporarily changing some other layer, undo your doesn't help, then try to temporarily change some other layer, undo your
changes and try again for the layer you want to change. Saving changes, and try again for the layer you want to change. Saving and
and reloading your map might also help. reloading your map also sometimes helps.
* You should be fine if you only change single layers without the use * You should be fine if you only change single layers without the use
of 'force'. Still it's advisable to save your game before messing with of 'force'. Still, it's advisable to save your game before messing with
the map. the map.
* When you force changelayer to convert soil to stone you might experience * When you force changelayer to convert soil to stone, you might see some
weird stuff (flashing tiles, tiles changed all over place etc). weird stuff (flashing tiles, tiles changed all over place etc). Try
Try reverting the changes manually or even better use an older savegame. reverting the changes manually or even better use an older savegame. You
You did save your game, right? did save your game, right?

@ -31,66 +31,14 @@ DFHACK_PLUGIN("changelayer");
REQUIRE_GLOBAL(world); REQUIRE_GLOBAL(world);
REQUIRE_GLOBAL(cursor); REQUIRE_GLOBAL(cursor);
const string changelayer_help =
" Allows to change the material of whole geology layers.\n"
" Can have impact on all surrounding regions, not only your embark!\n"
" By default changing stone to soil and vice versa is not allowed.\n"
" By default changes only the layer at the cursor position.\n"
" Note that one layer can stretch across lots of z levels.\n"
" By default changes only the geology which is linked to the biome under the\n"
" cursor. That geology might be linked to other biomes as well, though.\n"
" Mineral veins and gem clusters will stay on the map.\n"
" Use 'changevein' for them.\n\n"
" tl;dr: You will end up with changing quite big areas in one go.\n\n"
"Options (first parameter MUST be the material id):\n"
" all_biomes - Change layer for all biomes on your map.\n"
" Result may be undesirable since the same layer\n"
" can AND WILL be on different z-levels for different biomes.\n"
" Use the tool 'probe' to get an idea how layers and biomes\n"
" are distributed on your map.\n"
" all_layers - Change all layers on your map.\n"
" Candy mountain, anyone?\n"
" Will make your map quite boring, but tidy.\n"
" force - Allow changing stone to soil and vice versa.\n"
" !!THIS CAN HAVE WEIRD EFFECTS, USE WITH CARE!!\n"
" Note that soil will not be magically replaced with stone.\n"
" You will, however, get a stone floor after digging so it\n"
" will allow the floor to be engraved.\n"
" Note that stone will not be magically replaced with soil.\n"
" You will, however, get a soil floor after digging so it\n"
" could be helpful for creating farm plots on maps with no soil.\n"
" verbose - Give some more details about what is being changed.\n"
" trouble - Give some advice for known problems.\n"
"Example:\n"
" changelayer GRANITE\n"
" Convert layer at cursor position into granite.\n"
" changelayer SILTY_CLAY force\n"
" Convert layer at cursor position into clay even if it's stone.\n"
" changelayer MARBLE allbiomes alllayers\n"
" Convert all layers of all biomes into marble.\n";
const string changelayer_trouble =
"Known problems with changelayer:\n\n"
" Nothing happens, the material stays the old.\n"
" Pause/unpause the game and/or move the cursor a bit. Then retry.\n"
" Try changing another layer, undo the changes and try again.\n"
" Try saving and loading the game.\n\n"
" Weird stuff happening after using the 'force' option.\n"
" Change former stone layers back to stone, soil back to soil.\n"
" If in doubt, use the 'probe' tool to find tiles with soil walls\n"
" and stone layer type or the other way round.\n";
command_result changelayer (color_ostream &out, std::vector <std::string> & parameters); command_result changelayer (color_ostream &out, std::vector <std::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( commands.push_back(PluginCommand(
"changelayer", "Change a whole geology layer.", "changelayer",
changelayer, false, /* true means that the command can't be used from non-interactive user interface */ "Change a whole geology layer.",
// Extended help string. Used by CR_WRONG_USAGE and the help command: changelayer));
changelayer_help.c_str()
));
return CR_OK; return CR_OK;
} }
@ -120,13 +68,7 @@ command_result changelayer (color_ostream &out, std::vector <std::string> & para
{ {
if(parameters[i] == "help" || parameters[i] == "?") if(parameters[i] == "help" || parameters[i] == "?")
{ {
out.print("%s",changelayer_help.c_str()); return CR_WRONG_USAGE;
return CR_OK;
}
if(parameters[i] == "trouble")
{
out.print("%s",changelayer_trouble.c_str());
return CR_OK;
} }
if(parameters[i] == "force") if(parameters[i] == "force")
force = true; force = true;