|
|
|
@ -74,7 +74,6 @@ function export_more_legends_xml()
|
|
|
|
|
local date_str = year_str..string.format('-%02d-%02d', month, day)
|
|
|
|
|
|
|
|
|
|
io.output(tostring(df.global.world.cur_savegame.save_dir).."-"..date_str.."-legends_plus.xml")
|
|
|
|
|
--io.output(tostring(df.global.world.cur_savegame.save_dir).."-legends_plus.xml")
|
|
|
|
|
|
|
|
|
|
io.write ("<?xml version=\"1.0\" encoding='UTF-8'?>".."\n")
|
|
|
|
|
io.write ("<df_world>".."\n")
|
|
|
|
@ -128,7 +127,6 @@ function export_more_legends_xml()
|
|
|
|
|
end
|
|
|
|
|
io.write ("\t\t".."</structures>".."\n")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
io.write ("\t".."</site>".."\n")
|
|
|
|
|
end
|
|
|
|
@ -160,10 +158,9 @@ function export_more_legends_xml()
|
|
|
|
|
io.write ("\t\t".."<item_subtype>"..artifactV.item.subtype.name.."</item_subtype>".."\n")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if (table.containskey(artifactV.item,"description")) then
|
|
|
|
|
io.write ("\t\t".."<item_description>"..artifactV.item.description:lower().."</item_description>".."\n")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if (table.containskey(artifactV.item,"description")) then
|
|
|
|
|
io.write ("\t\t".."<item_description>"..artifactV.item.description:lower().."</item_description>".."\n")
|
|
|
|
|
end
|
|
|
|
|
if (artifactV.item:getMaterial() ~= -1 and artifactV.item:getMaterialIndex() ~= -1) then
|
|
|
|
|
io.write ("\t\t".."<mat>"..dfhack.matinfo.toString(dfhack.matinfo.decode(artifactV.item:getMaterial(), artifactV.item:getMaterialIndex())).."</mat>".."\n")
|
|
|
|
|
end
|
|
|
|
@ -171,8 +168,7 @@ function export_more_legends_xml()
|
|
|
|
|
end
|
|
|
|
|
io.write ("</artifacts>".."\n")
|
|
|
|
|
|
|
|
|
|
io.write ("<historical_figures>".."\n")
|
|
|
|
|
io.write ("</historical_figures>".."\n")
|
|
|
|
|
io.write ("<historical_figures>".."\n".."</historical_figures>".."\n")
|
|
|
|
|
|
|
|
|
|
io.write ("<entity_populations>".."\n")
|
|
|
|
|
for entityPopK, entityPopV in ipairs(df.global.world.entity_populations) do
|
|
|
|
@ -386,7 +382,6 @@ function export_more_legends_xml()
|
|
|
|
|
for detailK,detailV in pairs(v) do
|
|
|
|
|
io.write ("\t\t".."<"..k..">"..(df.global.world.raws.creatures.all[detailV].creature_id):lower().."</"..k..">".."\n")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
elseif event:getType() == df.history_event_type.BODY_ABUSED and (k == "props") then
|
|
|
|
|
io.write ("\t\t".."<"..k.."_item_type"..">"..tostring(df.item_type[event.props.item.item_type]):lower().."</"..k.."_item_type"..">".."\n")
|
|
|
|
|
io.write ("\t\t".."<"..k.."_item_subtype"..">"..getItemSubTypeName(event.props.item.item_type,event.props.item.item_subtype).."</"..k.."_item_subtype"..">".."\n")
|
|
|
|
@ -427,13 +422,12 @@ function export_more_legends_xml()
|
|
|
|
|
io.write ("\t\t".."<caste>"..(df.global.world.raws.creatures.all[event.race].caste[v].caste_id):lower().."</caste>".."\n")
|
|
|
|
|
end
|
|
|
|
|
elseif k == "interaction" and event:getType() == df.history_event_type.HF_DOES_INTERACTION then
|
|
|
|
|
io.write ("\t\t".."<interaction_action>"..df.global.world.raws.interactions[v].str[3].value.."</interaction_action>".."\n")
|
|
|
|
|
io.write ("\t\t".."<interaction_string>"..df.global.world.raws.interactions[v].str[4].value.."</interaction_string>".."\n")
|
|
|
|
|
io.write ("\t\t".."<interaction_action>"..df.global.world.raws.interactions[v].str[3].value.."</interaction_action>".."\n")
|
|
|
|
|
io.write ("\t\t".."<interaction_string>"..df.global.world.raws.interactions[v].str[4].value.."</interaction_string>".."\n")
|
|
|
|
|
elseif k == "interaction" and event:getType() == df.history_event_type.HF_LEARNS_SECRET then
|
|
|
|
|
io.write ("\t\t".."<secret_text>"..df.global.world.raws.interactions[v].str[2].value.."</secret_text>".."\n")
|
|
|
|
|
io.write ("\t\t".."<secret_text>"..df.global.world.raws.interactions[v].str[2].value.."</secret_text>".."\n")
|
|
|
|
|
elseif event:getType() == df.history_event_type.HIST_FIGURE_DIED and k == "weapon" then
|
|
|
|
|
for detailK,detailV in pairs(v) do
|
|
|
|
|
|
|
|
|
|
if (detailK == "item") then
|
|
|
|
|
if detailV > -1 then
|
|
|
|
|
io.write ("\t\t".."<"..detailK..">"..detailV.."</"..detailK..">".."\n")
|
|
|
|
@ -492,9 +486,9 @@ function export_more_legends_xml()
|
|
|
|
|
io.write ("\t\t".."<shooter_mat>"..dfhack.matinfo.toString(dfhack.matinfo.decode(event.weapon.shooter_mattype, event.weapon.shooter_matindex)).."</shooter_mat>".."\n")
|
|
|
|
|
end
|
|
|
|
|
elseif (detailK == "shooter_matindex") then
|
|
|
|
|
|
|
|
|
|
--skip
|
|
|
|
|
elseif detailK == "slayer_race" or detailK == "slayer_caste" then
|
|
|
|
|
|
|
|
|
|
--skip
|
|
|
|
|
else
|
|
|
|
|
io.write ("\t\t".."<"..detailK..">"..detailV.."</"..detailK..">".."\n")
|
|
|
|
|
end
|
|
|
|
@ -506,7 +500,6 @@ function export_more_legends_xml()
|
|
|
|
|
else
|
|
|
|
|
io.write ("\t\t".."<"..k..">"..tostring(v).."</"..k..">".."\n")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
io.write ("\t".."</historical_event>".."\n")
|
|
|
|
|
end
|
|
|
|
|