diff --git a/scripts/exportlegends.lua b/scripts/exportlegends.lua
index a0a04d9a2..65e84c28f 100644
--- a/scripts/exportlegends.lua
+++ b/scripts/exportlegends.lua
@@ -99,6 +99,73 @@ function export_more_legends_xml()
file:write(""..dfhack.df2utf(dfhack.TranslateName(df.global.world.world_data.name)).."\n")
file:write(""..dfhack.df2utf(dfhack.TranslateName(df.global.world.world_data.name,1)).."\n")
+ file:write("\n")
+ for formK, formV in ipairs(df.global.world.poetic_forms.all) do
+ for k,v in pairs(formV) do print(k,v) end
+ file:write("\t\n")
+ file:write("\t\t"..formV.id.."\n")
+ file:write("\t\t"..dfhack.df2utf(dfhack.TranslateName(formV.name,1)).."\n")
+ file:write("\t\n")
+ end
+ file:write("\n")
+
+ file:write("\n")
+ for formK, formV in ipairs(df.global.world.poetic_forms.all) do
+ file:write("\t\n")
+ file:write("\t\t"..formV.id.."\n")
+ file:write("\t\t"..dfhack.df2utf(dfhack.TranslateName(formV.name,1)).."\n")
+ file:write("\t\n")
+ end
+ file:write("\n")
+
+ file:write("\n")
+ for formK, formV in ipairs(df.global.world.dance_forms.all) do
+ file:write("\t\n")
+ file:write("\t\t"..formV.id.."\n")
+ file:write("\t\t"..dfhack.df2utf(dfhack.TranslateName(formV.name,1)).."\n")
+ file:write("\t\n")
+ end
+ file:write("\n")
+
+ file:write("\n")
+ for wcK, wcV in ipairs(df.global.world.written_contents.all) do
+ file:write("\t\n")
+ file:write("\t\t"..wcV.id.."\n")
+ file:write("\t\t"..wcV.title.."\n")
+ file:write("\t\t"..wcV.page_start.."\n")
+ file:write("\t\t"..wcV.page_end.."\n")
+ for refK, refV in pairs(wcV.refs) do
+ file:write("\t\t\n")
+ file:write("\t\t\t"..df.general_ref_type[refV:getType()].."\n")
+ if refV:getType() == 64 then file:write("\t\t\t"..refV.anon_1.."\n") -- written content
+ elseif refV:getType() == 0 then file:write("\t\t\t"..refV.artifact_id.."\n") -- artifact
+ elseif refV:getType() == 42 then file:write("\t\t\t"..refV.entity_id.."\n") -- entity
+ elseif refV:getType() == 49 then file:write("\t\t\t"..refV.event_id.."\n") -- event
+ elseif refV:getType() == 51 then file:write("\t\t\t"..refV.site_id.."\n") -- site
+ elseif refV:getType() == 52 then file:write("\t\t\t"..refV.region_id.."\n") -- region
+ elseif refV:getType() == 54 then file:write("\t\t\t"..refV.hist_figure_id.."\n") -- hist figure
+ elseif refV:getType() == 65 then file:write("\t\t\t"..refV.poetic_form_id.."\n") -- poetic form
+ elseif refV:getType() == 66 then file:write("\t\t\t"..refV.musical_form_id.."\n") -- musical form
+ elseif refV:getType() == 67 then file:write("\t\t\t"..refV.dance_form_id.."\n") -- dance form
+ elseif refV:getType() == 47 then -- TODO interaction
+ elseif refV:getType() == 60 then -- TODO scholar knowledge
+ elseif refV:getType() == 62 then -- TODO value level
+ elseif refV:getType() == 63 then -- TODO language
+ else
+ print("unknown reference",refV:getType(),df.general_ref_type[refV:getType()])
+ --for k,v in pairs(refV) do print(k,v) end
+ end
+ file:write("\t\t\n")
+ end
+ file:write("\t\t"..(df.written_content_type[wcV.type] or wcV.type).."\n")
+ for styleK, styleV in pairs(wcV.styles) do
+ file:write("\t\t