diff --git a/scripts/exportlegends.lua b/scripts/exportlegends.lua index 6e45b7be9..19664402b 100644 --- a/scripts/exportlegends.lua +++ b/scripts/exportlegends.lua @@ -128,28 +128,39 @@ function export_more_legends_xml() file:write("\n") for siteK, siteV in ipairs(df.global.world.world_data.sites) do - if (#siteV.buildings > 0) then - file:write("\t\n") - for k,v in pairs(siteV) do - if (k == "id") then - file:write("\t\t<"..k..">"..tostring(v).."\n") - elseif (k == "buildings") then + file:write("\t\n") + for k,v in pairs(siteV) do + if (k == "id" or k == "civ_id" or k == "cur_owner_id") then + file:write("\t\t<"..k..">"..tostring(v).."\n") + elseif (k == "buildings") then + if (#siteV.buildings > 0) then file:write("\t\t\n") for buildingK, buildingV in ipairs(siteV.buildings) do file:write("\t\t\t\n") file:write("\t\t\t\t"..buildingV.id.."\n") file:write("\t\t\t\t"..df.abstract_building_type[buildingV:getType()]:lower().."\n") if (df.abstract_building_type[buildingV:getType()]:lower() ~= "underworld_spire") then + -- if spire: unk_50 should be name and unk_bc some kind of flag file:write("\t\t\t\t"..dfhack.df2utf(dfhack.TranslateName(buildingV.name, 1)).."\n") file:write("\t\t\t\t"..dfhack.df2utf(dfhack.TranslateName(buildingV.name)).."\n") end + if (buildingV:getType() == df.abstract_building_type.TEMPLE) then + file:write("\t\t\t\t"..buildingV.deity.."\n") + file:write("\t\t\t\t"..buildingV.religion.."\n") + end + if (buildingV:getType() == df.abstract_building_type.DUNGEON) then + file:write("\t\t\t\t"..dfhack.df2utf(dfhack.TranslateName(buildingV.name)).."\n") + end + for inhabitabntK,inhabitabntV in pairs(buildingV.inhabitants) do + file:write("\t\t\t\t"..inhabitabntV.anon_2.."\n") + end file:write("\t\t\t\n") end file:write("\t\t\n") end end - file:write("\t\n") end + file:write("\t\n") end file:write("\n")