summaryrefslogtreecommitdiff
path: root/Lua API.html
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-05-06 19:09:11 +0400
committerAlexander Gavrilov2012-05-06 19:09:11 +0400
commit9ad8d767b4fcf0946444469d2c4072d46997b7e6 (patch)
treef49a082895fe73d400e64359e859806c173d00ef /Lua API.html
parentb70130cf3684d8adbf36023b27aec0f10b213cc7 (diff)
downloaddfhack-9ad8d767b4fcf0946444469d2c4072d46997b7e6.tar.gz
dfhack-9ad8d767b4fcf0946444469d2c4072d46997b7e6.tar.bz2
dfhack-9ad8d767b4fcf0946444469d2c4072d46997b7e6.tar.xz
Add code for adding abstract buildings and removing constructions.
Diffstat (limited to 'Lua API.html')
-rw-r--r--Lua API.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lua API.html b/Lua API.html
index 094b522c..7aa8e651 100644
--- a/Lua API.html
+++ b/Lua API.html
@@ -1126,6 +1126,11 @@ height, rect_area, true_area</em>. Returned width and height are the
final values used by the building; true_area is less than rect_area
if any tiles were removed from designation.</p>
</li>
+<li><p class="first"><tt class="docutils literal">dfhack.buildings.constructAbstract(building)</tt></p>
+<p>Links a fully configured object created by <tt class="docutils literal">allocInstance</tt> into the
+world. The object must be an abstract building, i.e. a stockpile or civzone.
+Returns <em>true</em>, or <em>false</em> if impossible.</p>
+</li>
<li><p class="first"><tt class="docutils literal">dfhack.buildings.constructWithItems(building, items)</tt></p>
<p>Links a fully configured object created by <tt class="docutils literal">allocInstance</tt> into the
world for construction, using a list of specific items as material.
@@ -1139,6 +1144,10 @@ and possibly destroyed in any case.
Use a negative <tt class="docutils literal">quantity</tt> field value to auto-compute the amount
from the size of the building.</p>
</li>
+<li><p class="first"><tt class="docutils literal">dfhack.buildings.deconstruct(building)</tt></p>
+<p>Destroys the building, or queues a deconstruction job.
+Returns <em>true</em> if the building was destroyed and deallocated immediately.</p>
+</li>
</ul>
<p>More high-level functions are implemented in lua and can be loaded by
<tt class="docutils literal"><span class="pre">require('dfhack.buildings')</span></tt>. See <tt class="docutils literal">hack/lua/dfhack/buildings.lua</tt>.</p>
@@ -1152,6 +1161,11 @@ a planned but not completed construction there, changes its type.
Returns <em>true</em>, or <em>false</em> if obstructed.
Note that designated constructions are technically buildings.</p>
</li>
+<li><p class="first"><tt class="docutils literal">dfhack.constructions.designateRemove(pos)</tt>, or <tt class="docutils literal">designateRemove(x,y,z)</tt></p>
+<p>If there is a construction or a planned construction at the specified
+coordinates, designates it for removal, or instantly cancels the planned one.
+Returns <em>true, was_only_planned</em> if removed; or <em>false</em> if none found.</p>
+</li>
</ul>
</div>
</div>