Diving into sites and how to alter them. so far you could swap out any existing buildings the site has to be anything, from marketgardens, to vaults to towers it's just that spawning a new one is super tricky and a headache.
that said, if you have a bunch of edits done to a site then swap the site-type to something different the game will flush the entire changes you did for remaking the site to the new type.
What this means is you can have a race of gnomes interconnected in a hilltop that has a lone section that goes into a tunnel system and have inhabitants be clockwork sentries.
Orcs having goblin trenches that you can safely cross in fast travel.
Succubi/demons having vaults that are filled to the brim with their kind or if you're going crazy a mix of angels and demons.
also sites also effect who loads up in the area so you can set the site to spawn in a certain race of masterwork creatures.
humans towns having loads of different building types.
here's the script I was using to fiddle with sites slowly modifying and altering stuff inside.
function advGlobalPos()
local map=df.global.world.map
local wd=df.global.world.world_data
local adv=df.global.world.units.active[0]
--wd.adv_region_x*16+wd.adv_emb_x,wd.adv_region_y*16+wd.adv_emb_y
--return wd.adv_region_x*16+wd.adv_emb_x,wd.adv_region_y*16+wd.adv_emb_y
--return wd.adv_region_x*16+wd.adv_emb_x+adv.pos.x/16,wd.adv_region_y*16+wd.adv_emb_y+adv.pos.y/16
--print(map.region_x,map.region_y,adv.pos.x,adv.pos.y)
--print(map.region_x+adv.pos.x/48, map.region_y+adv.pos.y/48,wd.adv_region_x*16+wd.adv_emb_x,wd.adv_region_y*16+wd.adv_emb_y)
return math.floor(map.region_x+adv.pos.x/48), math.floor(map.region_y+adv.pos.y/48)
end
local tx,ty=advGlobalPos()
--print(tx,ty)
for k,v in pairs(df.global.world.world_data.sites) do
local tp={v.pos.x,v.pos.y}
if tx>=tp[1]*16+v.rgn_min_x and tx<=tp[1]*16+v.rgn_max_x and
ty>=tp[2]*16+v.rgn_min_y and ty<=tp[2]*16+v.rgn_max_y then
print(k)
for Numbuild,builde in pairs(v.realization.buildings) do
v.realization.num_buildings=(Numbuild+1)
end
v.entity_links:insert("#",{new=df.entity_site_link,anon_5=-1})
require("utils").insert_sorted(v.realization.buildings,v.realization.buildings[0],"id")
--v.realization.buildings:insert("#",{new=v.realization.buildings[0]})
v.realization.buildings:insert("#",{new=df.site_realization_building,type=2,min_x=5,max_x=8,min_y=10,max_y=20,id=k+1})
end
end
you could possibly have it set up so it searches for site type then alter their building realization from there.
currently searching for the 'meadhall' zone so people in adventure mode can take over sites and not just hamlets.
though