@ -395,8 +396,8 @@ Alternatively, you might be able to use <tt class="docutils literal">lxc</tt> to
<aclass="reference external"href="http://www.bay12forums.com/smf/index.php?topic=139553.msg5435310#msg5435310">create a virtual 32-bit environment</a>.</p>
<aclass="reference external"href="http://www.bay12forums.com/smf/index.php?topic=139553.msg5435310#msg5435310">create a virtual 32-bit environment</a>.</p>
<p>Before you can build anything, you'll also need <ttclass="docutils literal">cmake</tt>. It is advisable to also get
<p>Before you can build anything, you'll also need <ttclass="docutils literal">cmake</tt>. It is advisable to also get
<ttclass="docutils literal">ccmake</tt> on distributions that split the cmake package into multiple parts.</p>
<ttclass="docutils literal">ccmake</tt> on distributions that split the cmake package into multiple parts.</p>
<p>For the code generation parts, you need perl and the XML::LibXML and XML::LibXSLT perl packages.
<p>You also need perl and the XML::LibXML and XML::LibXSLT perl packages (for the code generation parts).
You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt').</p>
You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt') or through <ttclass="docutils literal">cpan</tt>.</p>
<p>To build Stonesense, you'll also need OpenGL headers.</p>
<p>To build Stonesense, you'll also need OpenGL headers.</p>
<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="#id12">How to get the code</a></h2>
<h2><aclass="toc-backref"href="#id13">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>
@ -567,7 +574,7 @@ 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
@ -579,7 +586,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>
@ -601,7 +608,7 @@ So pick either Release or RelWithDebInfo build and build the INSTALL target.</p>
<h2><aclass="toc-backref"href="#id17">DF data structure definitions</a></h2>
<h2><aclass="toc-backref"href="#id18">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>
<p>Wraps strerror() - returns a string describing a platform-specific error code</p>
</li>
</ul>
</ul>
</div>
</div>
</div>
</div>
@ -3382,8 +3385,9 @@ plugin export a function it's recommended to use lua decorated function.</p>
<dd><olclass="first last arabic simple">
<dd><olclass="first last arabic simple">
<li>name -- custom workshop id e.g. <ttclass="docutils literal">SOAPMAKER</tt></li>
<li>name -- custom workshop id e.g. <ttclass="docutils literal">SOAPMAKER</tt></li>
<li>fix_impassible -- if true make impassible tiles impassible to liquids too</li>
<li>fix_impassible -- if true make impassible tiles impassible to liquids too</li>
<li>consume -- how much machine power is needed to work. Disables reactions if not supplied enough</li>
<li>consume -- how much machine power is needed to work. Disables reactions if not supplied enough and needs_power=1</li>
<li>produce -- how much machine power is produced. Use discouraged as there is no way to change this at runtime</li>
<li>produce -- how much machine power is produced.</li>
<li>needs_power -- if produced in network < consumed stop working, default true</li>
<li>gears -- a table or <ttclass="docutils literal"><spanclass="pre">{x=?,y=?}</span></tt> of connection points for machines</li>
<li>gears -- a table or <ttclass="docutils literal"><spanclass="pre">{x=?,y=?}</span></tt> of connection points for machines</li>
<li>action -- a table of number (how much ticks to skip) and a function which gets called on shop update</li>
<li>action -- a table of number (how much ticks to skip) and a function which gets called on shop update</li>
<li>animate -- a table of frames which can be a table of:<olclass="loweralpha">
<li>animate -- a table of frames which can be a table of:<olclass="loweralpha">
@ -3402,6 +3406,8 @@ plugin export a function it's recommended to use lua decorated function.</p>
</ol>
</ol>
</dd>
</dd>
</dl>
</dl>
<p><ttclass="docutils literal">getPower(building)</tt> returns two number - produced and consumed power if building can be modified and returns nothing otherwise</p>
<p><ttclass="docutils literal">setPower(building,produced,consumed)</tt> sets current productiona and consumption for a building.</p>