update docs for stockpiles

develop
myk002 2022-07-31 13:29:53 -07:00
parent 08d434d16e
commit 5621a19278
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 48 additions and 52 deletions

@ -2,27 +2,41 @@
stockpiles stockpiles
========== ==========
Offers the following commands to save and load stockpile settings. Tags:
See `gui/stockpiles` for an in-game interface. :dfhack-keybind:`copystock`
:dfhack-keybind:`savestock`
:dfhack-keybind:`loadstock`
:copystock: Copies the parameters of the currently highlighted stockpile to the custom Import and export stockpile settings. When the plugin is enabled, the :kbd:`q`
stockpile settings and switches to custom stockpile placement mode, effectively menu of each stockpile will have an option for saving or loading the stockpile
allowing you to copy/paste stockpiles easily. settings. See `gui/stockpiles` for an in-game interface.
:dfhack-keybind:`copystock`
:savestock: Saves the currently highlighted stockpile's settings to a file in your Dwarf Usage:
Fortress folder. This file can be used to copy settings between game saves or
players. e.g.: ``savestock food_settings.dfstock``
:loadstock: Loads a saved stockpile settings file and applies it to the currently selected ``enable stockpiles``
stockpile. e.g.: ``loadstock food_settings.dfstock`` Add a hotkey that you can hit to easily save and load settings from
stockpiles selected in :kbd:`q` mode.
``copystock``
Copies the parameters of the currently highlighted stockpile to the custom
stockpile settings and switches to custom stockpile placement mode,
effectively allowing you to copy/paste stockpiles easily.
``savestock <filename>``
Saves the currently highlighted stockpile's settings to a file in your
Dwarf Fortress folder. This file can be used to copy settings between game
saves or players.
``loadstock <filename>``
Loads a saved stockpile settings file and applies it to the currently
selected stockpile.
To use savestock and loadstock, use the :kbd:`q` command to highlight a stockpile. Filenames with spaces are not supported. Generated materials, divine metals,
Then run savestock giving it a descriptive filename. Then, in a different (or etc. are not saved as they are different in every world.
the same!) gameworld, you can highlight any stockpile with :kbd:`q` then execute the
``loadstock`` command passing it the name of that file. The settings will be
applied to that stockpile.
Note that files are relative to the DF folder, so put your files there or in a Examples
subfolder for easy access. Filenames should not have spaces. Generated materials, --------
divine metals, etc are not saved as they are different in every world.
``savestock food_settings.dfstock``
Export the stockpile settings for the stockpile currently selected in
:kbd:`q` mode to a file named ``food_settings.dfstock``.
``loadstock food_settings.dfstock``
Set the selected stockpile settings to those saved in the
``food_settings.dfstock`` file.

@ -61,39 +61,21 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <Plug
{ {
if ( world && ui ) if ( world && ui )
{ {
commands.push_back ( commands.push_back(PluginCommand(
PluginCommand ( "copystock",
"copystock", "Copy stockpile under cursor.", "Copy stockpile under cursor.",
copystock, copystock_guard, copystock,
" - In 'q' or 't' mode: select a stockpile and invoke in order\n" copystock_guard));
" to switch to the 'p' stockpile creation mode, and initialize\n" commands.push_back(PluginCommand(
" the custom settings from the selected stockpile.\n" "savestock",
" - In 'p': invoke in order to switch back to 'q'.\n" "Save the active stockpile's settings to a file.",
) savestock,
); savestock_guard));
commands.push_back ( commands.push_back(PluginCommand(
PluginCommand ( "loadstock",
"savestock", "Save the active stockpile's settings to a file.", "Load and apply stockpile settings from a file.",
savestock, savestock_guard, loadstock,
"Must be in 'q' mode and have a stockpile selected.\n" loadstock_guard));
"example: 'savestock food.dfstock' will save the settings to 'food.dfstock'\n"
"in your stockpile folder.\n"
"Omitting the filename will result in text output directly to the console\n\n"
" -d, --debug: enable debug output\n"
" <filename> : filename to save stockpile settings to (will be overwritten!)\n"
)
);
commands.push_back (
PluginCommand (
"loadstock", "Load and apply stockpile settings from a file.",
loadstock, loadstock_guard,
"Must be in 'q' mode and have a stockpile selected.\n"
"example: 'loadstock food.dfstock' will load the settings from 'food.dfstock'\n"
"in your stockpile folder and apply them to the selected stockpile.\n"
" -d, --debug: enable debug output\n"
" <filename> : filename to load stockpile settings from\n"
)
);
} }
return CR_OK; return CR_OK;