// This is a generic plugin that does nothing useful apart from acting as an example... of a plugin that does nothing :D // some headers required for a plugin. Nothing special, just the basics. #include "Core.h" #include #include #include #include // If you need to save data per-world: //#include "modules/Persistence.h" // DF data structure definition headers #include "DataDefs.h" //#include "df/world.h" // our own, empty header. #include "skeleton.h" using namespace DFHack; using namespace df::enums; // Expose the plugin name to the DFHack core, as well as metadata like the DFHack version. // The name string provided must correspond to the filename - // skeleton.plug.so, skeleton.plug.dylib, or skeleton.plug.dll in this case DFHACK_PLUGIN("skeleton"); // The identifier declared with this macro (ie. enabled) can be specified by the user // and subsequently used to manage the plugin's operations. // This will also be tracked by `plug`; when true the plugin will be shown as enabled. DFHACK_PLUGIN_IS_ENABLED(enabled); // Any globals a plugin requires (e.g. world) should be listed here. // For example, this line expands to "using df::global::world" and prevents the // plugin from being loaded if df::global::world is null (i.e. missing from symbols.xml): // REQUIRE_GLOBAL(world); // You may want some compile time debugging options // one easy system just requires you to cache the color_ostream &out into a global debug variable //#define P_DEBUG 1 //uint16_t maxTickFreq = 1200; //maybe you want to use some events command_result command_callback1(color_ostream &out, std::vector ¶meters); DFhackCExport command_result plugin_init(color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand("skeleton", "~54 character description of plugin", //to use one line in the ``[DFHack]# ls`` output command_callback1, false, "example usage" " skeleton