<p>On Windows, DFHack replaces the SDL library distributed with DF.</p>
<p>On Windows, DFHack replaces the SDL library distributed with DF.</p>
<divclass="section"id="id1">
<divclass="section"id="id1">
<h2><aclass="toc-backref"href="#id11">How to get the code</a></h2>
<h2><aclass="toc-backref"href="#id12">How to get the code</a></h2>
<p>DFHack doesn't have any kind of system of code snapshots in place, so you will have to get code from the github repository using git.
<p>DFHack doesn't have any kind of system of code snapshots in place, so you will have to get code from the github repository using git.
You will need some sort of Windows port of git, or a GUI. Some examples:</p>
You will need some sort of Windows port of git, or a GUI. Some examples:</p>
<blockquote>
<blockquote>
@ -511,13 +544,14 @@ git submodule update
<p>If you want to get really involved with the development, create an account on github, make a clone there and then use that as your remote repository instead. Detailed instructions are beyond the scope of this document. If you need help, join us on IRC (#dfhack channel on freenode).</p>
<p>If you want to get really involved with the development, create an account on github, make a clone there and then use that as your remote repository instead. Detailed instructions are beyond the scope of this document. If you need help, join us on IRC (#dfhack channel on freenode).</p>
<p>It has the usual installer wizard. Make sure you let it add its binary folder
<p>It has the usual installer wizard. Make sure you let it add its binary folder
to your binary search PATH so the tool can be later run from anywhere.</p>
to your binary search PATH so the tool can be later run from anywhere.</p>
<p>You'll need a copy of Microsoft Visual C++ 2010. The Express version is sufficient.
<p>You'll need a copy of Microsoft Visual C++ 2010. The Express version is sufficient.
Grab it from Microsoft's site.</p>
Grab it from Microsoft's site.</p>
<p>You'll also need the Visual Studio 2010 SP1 update.</p>
<p>For the code generation parts, you'll need perl and XML::LibXML. You can install them like this:</p>
<p>For the code generation parts, you'll need perl and XML::LibXML. You can install them like this:</p>
<ulclass="simple">
<ulclass="simple">
<li>download and install strawberry perl from <aclass="reference external"href="http://strawberryperl.com/">http://strawberryperl.com/</a></li>
<li>download and install strawberry perl from <aclass="reference external"href="http://strawberryperl.com/">http://strawberryperl.com/</a></li>
@ -528,7 +562,7 @@ Grab it from Microsoft's site.</p>
<p>If you already have a different version of perl (for example the one from cygwin), you can run into some trouble. Either remove the other perl install from PATH, or install libxml and libxslt for it instead. Strawberry perl works though and has all the required packages.</p>
<p>If you already have a different version of perl (for example the one from cygwin), you can run into some trouble. Either remove the other perl install from PATH, or install libxml and libxslt for it instead. Strawberry perl works though and has all the required packages.</p>
<p>There are several different batch files in the <ttclass="docutils literal">build</tt> folder along with a script that's used for picking the DF path.</p>
<p>There are several different batch files in the <ttclass="docutils literal">build</tt> folder along with a script that's used for picking the DF path.</p>
<p>First, run set_df_path.vbs and point the dialog that pops up at your DF folder that you want to use for development.
<p>First, run set_df_path.vbs and point the dialog that pops up at your DF folder that you want to use for development.
Next, run one of the scripts with <ttclass="docutils literal">generate</tt> prefix. These create the MSVC solution file(s):</p>
Next, run one of the scripts with <ttclass="docutils literal">generate</tt> prefix. These create the MSVC solution file(s):</p>
@ -550,7 +584,7 @@ So pick either Release or RelWithDebInfo build and build the INSTALL target.</p>
<h2><aclass="toc-backref"href="#id16">DF data structure definitions</a></h2>
<h2><aclass="toc-backref"href="#id17">DF data structure definitions</a></h2>
<p>DFHack uses information about the game data structures, represented via xml files in the library/xml/ submodule.</p>
<p>DFHack uses information about the game data structures, represented via xml files in the library/xml/ submodule.</p>
<p>Data structure layouts are described in files following the df.*.xml name pattern. This information is transformed by a perl script into C++ headers describing the structures, and associated metadata for the Lua wrapper. These headers and data are then compiled into the DFHack libraries, thus necessitating a compatibility break every time layouts change; in return it significantly boosts the efficiency and capabilities of DFHack code.</p>
<p>Data structure layouts are described in files following the df.*.xml name pattern. This information is transformed by a perl script into C++ headers describing the structures, and associated metadata for the Lua wrapper. These headers and data are then compiled into the DFHack libraries, thus necessitating a compatibility break every time layouts change; in return it significantly boosts the efficiency and capabilities of DFHack code.</p>
<p>Global object addresses are stored in symbols.xml, which is copied to the dfhack release package and loaded as data at runtime.</p>
<p>Global object addresses are stored in symbols.xml, which is copied to the dfhack release package and loaded as data at runtime.</p>
<p>DFHack supports remote access by exchanging Google protobuf messages via a TCP socket. Both the core and plugins can define remotely accessible methods. The <ttclass="docutils literal"><spanclass="pre">dfhack-run</span></tt> command uses this interface to invoke ordinary console commands.</p>
<p>DFHack supports remote access by exchanging Google protobuf messages via a TCP socket. Both the core and plugins can define remotely accessible methods. The <ttclass="docutils literal"><spanclass="pre">dfhack-run</span></tt> command uses this interface to invoke ordinary console commands.</p>
<p>Currently the supported set of requests is limited, because the developers don't know what exactly is most useful.</p>
<p>Currently the supported set of requests is limited, because the developers don't know what exactly is most useful.</p>
<p>Protocol client implementations exist for Java and C#.</p>
<p>Protocol client implementations exist for Java and C#.</p>
</div>
</div>
<divclass="section"id="contributing-to-dfhack">
<divclass="section"id="contributing-to-dfhack">
<h2><aclass="toc-backref"href="#id18">Contributing to DFHack</a></h2>
<h2><aclass="toc-backref"href="#id19">Contributing to DFHack</a></h2>
<p>Several things should be kept in mind when contributing to DFHack.</p>
<p>Several things should be kept in mind when contributing to DFHack.</p>