In most cases, the only special library you're going to use is going to be "lua", and only if your plugin is going to provide special functions that can be invoked from scripts. The good news is that most libraries normally used in C++ have a high probability to be already used by some other plugin. The libraries are all the 3rd-party libraries you want to use in your project. Only a handful of plugins use that technology, such as rename and isoworldremote. As such, it is outside of the scope of this document. so you can write a separate application that communicates with DFHack to access/modify the game's memory). Protobuf (protocol buffer) is a special serialization standard developed by Google, and its main use in DFHack is for communicating with other processes via TCP/IP (e.g. A set of C++ source files (there can be just one if you want!).In the full list of projects, uncheck ALL_BUILD, and instead check INSTALLĬreate your very own plugin What are the requirements for a plugin?.Go to "configuration properties"–>"Configuration".Right-click on the Solution, and select "Properties".To save some time, here is how you can set up Visual C++ to do a build+install every time you press F7: Make yourself comfy Windows Īs explained in the compiling guidelines (above), there are several scripts available, that will do different things : some will just build, some will also install the results to your DF's "hack" folder. Follow exactly the steps described in DFHack's documentation:.You must download the sources, and build them. Type die in that window to observe that the command line works ( die is a command to force-close DF). You can run DF once and observe the DFHack console.
I'd recommend getting the latest "Lazy Newb Pack", which includes not only Dwarf Fortress but also DFHack and other nice things, ready-to-use: You'll need a test environment to run your script. It is intended for people who are totally new to DFHack. This document explains how to get started at writing C++ plugins with Microsoft Visual C++ 2010, step by step. This document is focused entirely on plugins - if you would like to learn more about writing scripts, see Certain things can be easier to do, and error handling is better in general, but the downside is that they can be quite slow - for example, trying to reveal the entire map from Lua may take an entire minute, while the C++ plugin can do it in a tiny fraction of a second. Lua and Ruby scripts: text-based scripts which can be dropped into place and modified on the fly.They can use DFHack's low level functions very closely, and they will be able to perform complex functions very quickly. C++ plugins: libraries written in C++ that need to be compiled.It is possible for developers to write plugins for DFHack, in order to extend the capabilities of DFHack (and therefore DF's gameplay). 7 Simplest possible plugin: Hello world!ĭFHack is a Dwarf Fortress (DF) memory access library and a set of basic tools that use it (see the documentation at ).
Only use when you are doing exploratory miningįillneeds -all - or individual selected = fill unfillable needs so dwarves stop moping about being away from family. Don't use this when trying to dig rooms and things or you will turn your fort into an exploratory mine. WorkNow 2: make dwarves look for jobs whenever a job completesĭigFlood 1 =Ěutomatically digs out specified veins as they are discoveredĭigFlood digAll1 i think marks every vein encountered as dig. WorkNow 1: activate workNow (look for jobs on pause, and only then) WorkNow - Don’t allow dwarves to idle if any jobs are available. Items: dump items in the cage, excluding stuff worn by caged creaturesĪrmor: dump everything worn by caged creatures (including armor and clothing)Īll: dump everything in the cage, on a creature or not Arguments: list: display the list of all cages and their item content on the console supposedly works with autodump, but for me when I try the items don't dump, they stay were they are and become forbidden as if they were dumped. Stripcaged = For dumping items inside cages. Can cause weirdnessĮmigration enable/disable = stressed dorfs move out Tweak make own = makes a creature a member of your civ. Autounsuspend = Automatically unsuspend construction jobs, on a recurring basis.