|
|
@ -74,7 +74,6 @@ function export_more_legends_xml()
|
|
|
|
local date_str = year_str..string.format('-%02d-%02d', month, day)
|
|
|
|
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).."-"..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 ("<?xml version=\"1.0\" encoding='UTF-8'?>".."\n")
|
|
|
|
io.write ("<df_world>".."\n")
|
|
|
|
io.write ("<df_world>".."\n")
|
|
|
@ -128,7 +127,6 @@ function export_more_legends_xml()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
io.write ("\t\t".."</structures>".."\n")
|
|
|
|
io.write ("\t\t".."</structures>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
io.write ("\t".."</site>".."\n")
|
|
|
|
io.write ("\t".."</site>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -163,7 +161,6 @@ function export_more_legends_xml()
|
|
|
|
if (table.containskey(artifactV.item,"description")) then
|
|
|
|
if (table.containskey(artifactV.item,"description")) then
|
|
|
|
io.write ("\t\t".."<item_description>"..artifactV.item.description:lower().."</item_description>".."\n")
|
|
|
|
io.write ("\t\t".."<item_description>"..artifactV.item.description:lower().."</item_description>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if (artifactV.item:getMaterial() ~= -1 and artifactV.item:getMaterialIndex() ~= -1) then
|
|
|
|
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")
|
|
|
|
io.write ("\t\t".."<mat>"..dfhack.matinfo.toString(dfhack.matinfo.decode(artifactV.item:getMaterial(), artifactV.item:getMaterialIndex())).."</mat>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -171,8 +168,7 @@ function export_more_legends_xml()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
io.write ("</artifacts>".."\n")
|
|
|
|
io.write ("</artifacts>".."\n")
|
|
|
|
|
|
|
|
|
|
|
|
io.write ("<historical_figures>".."\n")
|
|
|
|
io.write ("<historical_figures>".."\n".."</historical_figures>".."\n")
|
|
|
|
io.write ("</historical_figures>".."\n")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io.write ("<entity_populations>".."\n")
|
|
|
|
io.write ("<entity_populations>".."\n")
|
|
|
|
for entityPopK, entityPopV in ipairs(df.global.world.entity_populations) do
|
|
|
|
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
|
|
|
|
for detailK,detailV in pairs(v) do
|
|
|
|
io.write ("\t\t".."<"..k..">"..(df.global.world.raws.creatures.all[detailV].creature_id):lower().."</"..k..">".."\n")
|
|
|
|
io.write ("\t\t".."<"..k..">"..(df.global.world.raws.creatures.all[detailV].creature_id):lower().."</"..k..">".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
elseif event:getType() == df.history_event_type.BODY_ABUSED and (k == "props") then
|
|
|
|
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_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")
|
|
|
|
io.write ("\t\t".."<"..k.."_item_subtype"..">"..getItemSubTypeName(event.props.item.item_type,event.props.item.item_subtype).."</"..k.."_item_subtype"..">".."\n")
|
|
|
@ -433,7 +428,6 @@ function export_more_legends_xml()
|
|
|
|
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
|
|
|
|
elseif event:getType() == df.history_event_type.HIST_FIGURE_DIED and k == "weapon" then
|
|
|
|
for detailK,detailV in pairs(v) do
|
|
|
|
for detailK,detailV in pairs(v) do
|
|
|
|
|
|
|
|
|
|
|
|
if (detailK == "item") then
|
|
|
|
if (detailK == "item") then
|
|
|
|
if detailV > -1 then
|
|
|
|
if detailV > -1 then
|
|
|
|
io.write ("\t\t".."<"..detailK..">"..detailV.."</"..detailK..">".."\n")
|
|
|
|
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")
|
|
|
|
io.write ("\t\t".."<shooter_mat>"..dfhack.matinfo.toString(dfhack.matinfo.decode(event.weapon.shooter_mattype, event.weapon.shooter_matindex)).."</shooter_mat>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elseif (detailK == "shooter_matindex") then
|
|
|
|
elseif (detailK == "shooter_matindex") then
|
|
|
|
|
|
|
|
--skip
|
|
|
|
elseif detailK == "slayer_race" or detailK == "slayer_caste" then
|
|
|
|
elseif detailK == "slayer_race" or detailK == "slayer_caste" then
|
|
|
|
|
|
|
|
--skip
|
|
|
|
else
|
|
|
|
else
|
|
|
|
io.write ("\t\t".."<"..detailK..">"..detailV.."</"..detailK..">".."\n")
|
|
|
|
io.write ("\t\t".."<"..detailK..">"..detailV.."</"..detailK..">".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -506,7 +500,6 @@ function export_more_legends_xml()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
io.write ("\t\t".."<"..k..">"..tostring(v).."</"..k..">".."\n")
|
|
|
|
io.write ("\t\t".."<"..k..">"..tostring(v).."</"..k..">".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
io.write ("\t".."</historical_event>".."\n")
|
|
|
|
io.write ("\t".."</historical_event>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|