From b70130cf3684d8adbf36023b27aec0f10b213cc7 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 6 May 2012 11:22:55 +0400 Subject: Add a couple more building api functions. --- Lua API.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Lua API.html') diff --git a/Lua API.html b/Lua API.html index b96d1215..094b522c 100644 --- a/Lua API.html +++ b/Lua API.html @@ -1081,9 +1081,14 @@ burrows, or the presence of invaders.
dfhack.buildings.getSize(building)
Returns width, height, centerx, centery.
dfhack.buildings.findAtTile(pos)
+dfhack.buildings.findAtTile(pos), or findAtTile(x,y,z)
Scans the buildings for the one located at the given tile. -Does not work on civzones. Warning: linear scan.
+Does not work on civzones. Warning: linear scan if the map +tile indicates there are buildings at it. +dfhack.buildings.findCivzonesAt(pos), or findCivzonesAt(x,y,z)
+Scans civzones, and returns a lua sequence of those that touch +the given tile, or nil if none.
dfhack.buildings.getCorrectSize(width, height, type, subtype, custom, direction)
Computes correct dimensions for the specified building type and orientation, @@ -1098,6 +1103,9 @@ are removed from extents. If allow_occupied, t
dfhack.buildings.countExtentTiles(extents,defval)
Returns the number of tiles included by extents, or defval.
dfhack.buildings.containsTile(building, x, y[, room])
+Checks if the building contains the specified tile, either directly, or as room.
+dfhack.buildings.hasSupport(pos,size)
Checks if a bridge constructed at specified position would have support from terrain, and thus won't collapse if retracted.
@@ -1113,7 +1121,7 @@ at specified position. Returns the object, or nil in case of an error.<Configures an object returned by allocInstance, using specified parameters wherever appropriate. If the building has fixed size along any dimension, the corresponding input parameter will be ignored. -Returns nil if the building cannot be placed, or true, width, +Returns false if the building cannot be placed, or true, width, height, rect_area, true_area. 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.
-- cgit v1.2.1