I've written a new plugin for DFHack, called seedwatch, which is for fortress mode.
It can watch the quantities of seeds, and change whether the seeds and the plant grown from those seeds are allowed to be cooked. In that way, you can cook seeds and plants without worrying that you will run out of seeds for planting (except when your dwarves eat the seeds raw - can't help with that!).
Thanks to
Quietust for the information
http://www.bay12forums.com/smf/index.php?topic=91166.msg2605147#msg2605147I've got a GitHub for it
https://github.com/gsvslto/dfhack/blob/master/plugins/seedwatch.cppUnfortunately, there are problems:
- It doesn't work for Linux Dwarf Fortress. This is due to ...
- The access to the cookery exclusions structures in DF memory is a hardcoded memory hack, rather than through a DFHack module, as currently there is no such feature. The kludge is at line 276 of seedwatch.cpp (in the t_kitchenExclusions::start method), and also at lines 107-144 (in the t_kitchenExclusions constructor). I don't really know how to add the memory locations to memory.xml and use them in a module (either a currently existing one, or a new one).
However, as a general point, the cookery exclusions list in DF does allow DFHack (main program, modules, and plugins) to store information in the save game files for a particular fortress. This is because, apart from the kinds of entries which
do mean that an item is excluded from cookery, the entries in the cookery exclusions list (that is, the five co-ordinated vectors, listed in Quietust's post) have no effect upon DF, and yet are nevertheless saved in the save game files. Therefore, by ensuring that the format of the information does not clash with legitimate cookery exclusion entries, such information can be stored in the save game via the cookery exclusions list. This feature may be useful for other plugins and DFHack itself, as long the information does not clash with that stored by
other plugins, modules, etc.
This storage facility is used by seedwatch to store which seed types the user wants to have watched and the limits for them, so that this information is automatically loaded by seedwatch when the game is loaded, and stored there when it is saved. Therefore the user does not have to issue commands to seedwatch for a particular fortress each time that fortress is loaded.
Hopefully seedwatch will be useful for some people, or at least the basis for something useful. I've tried to helpfully comment the code, and to make the help information clear, which can be viewed using #seedwatch info, in the DFHack console. Of course, if there are any questions or suggestions, I'll try my best. I don't think it's quite ready to be pulled into the main DFHack code at the moment, mostly due to the failure with Linux.