From e285ee31a406b4aba936615d4788e6b9f129980e Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 6 Feb 2023 03:28:19 -0800 Subject: [PATCH] tweak defaults, load initial races immediately --- docs/changelog.txt | 2 ++ docs/plugins/autobutcher.rst | 7 +++---- plugins/autobutcher.cpp | 12 +++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index ea140f451..626191f9f 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -40,6 +40,8 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Misc Improvements - `automelt`: is now more resistent to savegame corruption +- `autobutcher`: changed defaults from 5 females / 1 male to 4 females / 2 males so a single unfortunate accident doesn't leave players without a mating pair +- `autobutcher`: now immediately loads races available at game start into the watchlist ## Documentation diff --git a/docs/plugins/autobutcher.rst b/docs/plugins/autobutcher.rst index 1a4aa4f91..7e5b6b024 100644 --- a/docs/plugins/autobutcher.rst +++ b/docs/plugins/autobutcher.rst @@ -18,8 +18,8 @@ watch list. Units will be ignored if they are: Creatures who will not reproduce (because they're not interested in the opposite sex or have been gelded) will be butchered before those who will. Older adults and younger children will be butchered first if the population -is above the target (defaults are: 1 male kid, 5 female kids, 1 male adult, -5 female adults). Note that you may need to set a target above 1 to have a +is above the target (defaults are: 2 male kids, 4 female kids, 2 male adults, +4 female adults). Note that you may need to set a target above 1 to have a reliable breeding population due to asexuality etc. See `fix-ster` if this is a problem. @@ -34,7 +34,7 @@ Usage ``autobutcher autowatch`` Automatically add all new races (animals you buy from merchants, tame yourself, or get from migrants) to the watch list using the default target - counts. + counts. This option is enabled by default. ``autobutcher noautowatch`` Stop auto-adding new races to the watch list. ``autobutcher target all|new| [ ...]`` @@ -108,4 +108,3 @@ fortress:: autobutcher target 2 2 4 2 ALPACA SHEEP LLAMA autobutcher target 5 5 6 2 PIG autobutcher target 0 0 0 0 new - autobutcher autowatch diff --git a/plugins/autobutcher.cpp b/plugins/autobutcher.cpp index 3e76796cb..28667bbe7 100644 --- a/plugins/autobutcher.cpp +++ b/plugins/autobutcher.cpp @@ -107,6 +107,8 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { DEBUG(status,out).print("%s from the API; persisting\n", is_enabled ? "enabled" : "disabled"); set_config_bool(CONFIG_IS_ENABLED, is_enabled); + if (enable) + autobutcher_cycle(out); } else { DEBUG(status,out).print("%s from the API, but already %s; no action\n", is_enabled ? "enabled" : "disabled", @@ -130,11 +132,11 @@ DFhackCExport command_result plugin_load_data (color_ostream &out) { config = World::AddPersistentData(CONFIG_KEY); set_config_bool(CONFIG_IS_ENABLED, is_enabled); set_config_val(CONFIG_CYCLE_TICKS, 6000); - set_config_bool(CONFIG_AUTOWATCH, false); - set_config_val(CONFIG_DEFAULT_FK, 5); - set_config_val(CONFIG_DEFAULT_MK, 1); - set_config_val(CONFIG_DEFAULT_FA, 5); - set_config_val(CONFIG_DEFAULT_MA, 1); + set_config_bool(CONFIG_AUTOWATCH, true); + set_config_val(CONFIG_DEFAULT_FK, 4); + set_config_val(CONFIG_DEFAULT_MK, 2); + set_config_val(CONFIG_DEFAULT_FA, 4); + set_config_val(CONFIG_DEFAULT_MA, 2); } // we have to copy our enabled flag into the global plugin variable, but