Closed hrantzsch closed 1 year ago
Could you run :lua ~dfhack.gui.getCurFocus()
with the legends screen open and paste its output?
open-legends
is intended for when you don't have the legends screen opened, so that makes sense.
Sure:
> :lua ~dfhack.gui.getCurFocus()
table: 0000000008E1A5B0
1 = legends
Dunno if it helps at all, but I'm seeing the same behavior: (folder "SteamLibrary\steamapps\common\Dwarf Fortress\legends-region2-00119-12-11" created, no files)
[DFHack]# exportlegends all
Writing all files in: legends-region2-00119-12-11
exportlegends must be run from the main legends view
[DFHack]# :lua ~dfhack.gui.getCurFocus()
table: 00000171D697AE30
1 = legends
Hmm, fwiw, maybe the screenfinder is behaving differently in premium? Seems like this is the currently unhappy line https://github.com/DFHack/scripts/blob/master/exportlegends.lua#L1187 but I've never compiled dfhack.
@lethosor Lemme know if you think you won't be able to get to it anytime soon and I'll educate myself / see if I can't make a working PR for your consideration.
[DFHack]# :lua ~dfhack.gui.getCurFocus() == "legends"
false
[DFHack]# :lua ~dfhack.gui.getCurFocus()[0] == "legends"
false
[DFHack]# :lua ~dfhack.gui.getCurFocus()[1] == "legends"
true
no idea what the previous behavior was.
So by trying to change https://github.com/DFHack/scripts/blob/master/exportlegends.lua#L1187 localy inside hack folder as noted by @drewbuschhorn I got next results:
Also after exportlegends info
dfhack's ingame gui starting to behave unstable (some menus wont open, or crush).
I don't have any lua background but still will continue to poke around trying to do something.
Invoking: exportlegends maps
...team\steamapps\common\Dwarf Fortress\hack\lua\dfhack.lua:533: attempt to index a nil value (local 'scr_type')
stack traceback:
Okay so I tried to find what can I do about index nil value
(because it was kinda same error from the beginning) and changed ~/DF/hack/lua/dfhack.lua#L533
to if not scr == nil and scr_type:is_instance(scr) then
by adding not scr == nil
. My reasoning was the fact that by looks of function dfhack iterate over attributes scr
and the first attribute is a child = nil
Invoking: :lua ~dfhack.gui.getCurViewscreen()
<viewscreen_legendsst: 000000000763AE50>
child = nil
parent = <viewscreen: 000000014131A928>
breakdown_level = 0
option_key_pressed = 0
unhid_sum = 1738
init_stage = -1
init_cur_era = 1
init_cur_era_num = 0
init_cur_era_denom = 0
init_sub_stage = 0
histfigs = <vector<int32_t>[859]: 000000000763AE88>
sites = <vector<int32_t>[99]: 000000000763AEA0>
artifacts = <vector<int32_t>[0]: 000000000763AEB8>
...more input
In my mind this check should allow us to get some expected result. And by doing so and retyping exportlegends maps
i got
[DFHack]# exportlegends maps
Writing all files in: legends-region3-00005-07-19
Done exporting.
Could not find legends screen
Exported files can be found in the "legends-region3-00005-07-19" folder.
And now folder consists of errorlog.txt
and empty legends dir. Hooray?
After some more code tracing and manual commands I decided to try to manually export XML from Legends mode inside the game. None of legacy keybinds (x
,d
,p
) doesn't work for me. It may be due to me using Linux but also wiki for Legends mode and XML dumps have a unknown tags indicating that those commands may currently be non functional.
Anyway will continue to pocking around.
You won't be able to trigger vanilla legends export until it's back in the vanilla game. It might come with 50.08, but no guarantees.
Until then, the most useful thing to get working is the export of the extra info that DFHack itself is responsible for writing.
If you're feeling ambitious, the next thing exportlegends needs is a status GUI that shows live progress.
exportlegends custom
(or any other subcommand) exports nothing and only creates an empty folder on DFHack 50.07-alpha1 with Steam DF v50.07. It printsI'm pretty sure the main legends view is where I am. Opening a category like "Historical figures" doesn't help either.
I saw that https://github.com/DFHack/scripts/commit/ec85750330cffd381d82d5ad300d81be86996762 updated the script saying it seems to work for v50, so I'm wondering if I'm just holding it wrong. FWIW, running
open-legends
claims "legends screen already displayed".