update docs for petcapRemover

and make it actually start running when it is enabled
develop
myk002 2022-07-28 16:46:10 -07:00
parent a09b35c2bd
commit 2e2abbe87a
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 33 additions and 26 deletions

@ -1,19 +1,32 @@
petcapRemover
=============
Allows you to remove or raise the pet population cap. In vanilla
DF, pets will not reproduce unless the population is below 50 and the number of
children of that species is below a certain percentage. This plugin allows
removing the second restriction and removing or raising the first. Pets still
require PET or PET_EXOTIC tags in order to reproduce. Type ``help petcapRemover``
for exact usage. In order to make population more stable and avoid sudden
population booms as you go below the raised population cap, this plugin counts
pregnancies toward the new population cap. It can still go over, but only in the
case of multiple births.
Tags:
:dfhack-keybind:`petcapRemover`
Modify the pet population cap. In vanilla DF, pets will not reproduce unless the
population is below 50 and the number of children of that species is below a
certain percentage. This plugin allows removing these restrictions and setting
your own thresholds. Pets still require PET or PET_EXOTIC tags in order to
reproduce. In order to make population more stable and avoid sudden population
booms as you go below the raised population cap, this plugin counts pregnancies
toward the new population cap. It can still go over, but only in the case of
multiple births.
Usage:
:petcapRemover: cause pregnancies now and schedule the next check
:petcapRemover every n: set how often in ticks the plugin checks for possible pregnancies
:petcapRemover cap n: set the new cap to n. if n = 0, no cap
:petcapRemover pregtime n: sets the pregnancy duration to n ticks. natural pregnancies are
300000 ticks for the current race and 200000 for everyone else
``enable petcapRemover``
Enables the plugin and starts running with default settings.
``petcapRemover cap <value>``
Set the new population cap per species to the specified value. If set to 0,
then there is no cap (good luck with all those animals!). The default cap
is 100.
``petcapRemover``
Impregnate female pets that have access to a compatible male, up to the
population cap.
``petcapRemover every <ticks>``
Set how often the plugin will cause pregnancies. The default frequency is
every 10,000 ticks (a little over 8 game days).
``petcapRemover pregtime <ticks>``
Sets the pregnancy duration to the specified number of ticks. The default
value is 200,000 ticks, which is the natural pet pregnancy duration.

@ -36,18 +36,8 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <Plug
{
commands.push_back(PluginCommand(
"petcapRemover",
"Remove the pet population cap by causing pregnancies.",
petcapRemover,
false, //allow non-interactive use
"petcapRemover\n"
" does pregnancies now and schedules the next check\n"
"petcapRemover every n\n"
" set how often in ticks the plugin checks for possible pregnancies\n"
"petcapRemover cap n\n"
" sets the new cap to n. if n = 0, no cap. Caps between 1 and 50 effectively don't do anything because normal DF pregnancies will continue to happen below that cap.\n"
"petcapRemover pregtime n\n"
" sets the pregnancy duration to n ticks. Natural pregnancies are 300000 ticks for the current race and 200000 ticks for everyone else.\n"
));
"Modify the pet population cap.",
petcapRemover));
return CR_OK;
}
@ -204,6 +194,10 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable)
is_enabled = enable;
if ( !is_enabled ) {
EventManager::unregisterAll(plugin_self);
} else {
// start the cycle
vector<string> params;
return petcapRemover(out, params);
}
}