My real life has been getting in the way of serious DF-ing lately, but will soon be trying to update my mod for 0.42 using the DFHack alpha.
From a Lua script, is it possible to determine if a tile is in a "location" and interrogate some of its characteristics? The current use case is:
Right now, the mod includes these bulky 3x3 workshops called Tributes that give access to some of the mod's more useful reactions. I already have a script that allows the player to build a generic Tribute and switch it to the appropriate specific one based on the material used (that is, a generic Tribute made from granite will complete as a Tribute To Granite). I intend to keep this option, but want to add another.
It makes sense that a smaller 1x1 Altar should be able to perform the same reactions, but only if the Altar is built in an "appropriate" place. Appropriate means: the tile's base material is the same as the block used to make the Altar, and it is in a Temple dedicated to a deity/entity with at least one Sphere in common with the mod's canon for stone-to-Sphere matching (e.g., metamorphic stones match the EARTH and MOUNTAINS Spheres while igneous intrusive match MOUNTAINS and CAVERNS).
So, a player building a Altar with a granite block in a granite layer in a Temple dedicated to a deity associated with MOUNTAINS or CAVERNS should end up with a functional Altar To Granite. A constructed floor or paving would not be sufficiently "granite" to allow a functional Altar.
If the player gets something wrong, they should end up with a nonfunctional Altar or better yet a deconstructed block.
Do we know enough about a tile to find its location(s), enough about the location to find the deity, and then enough about the deity to find the Spheres?