151
Utilities and 3rd Party Applications / Re: dfHack 43.05 - list/extract (point) Notes ?
« on: December 04, 2017, 03:09:08 pm »Ok, found the code in gm-editor.lua / function GmEditorUi:pushTargetOh wow... I'll give you kudos for that. That file is unreadable :|
Thanks for the hints on what to look for.
Heh, trial and errror .... every now and then a "blind animal finds ...."
I know a tiny bit of Lua, the rest I "google".
While using gm-editor works for producing text output, I still have to interactively "pick" / edit an entry for it to be "dumped" to the console.
There should be a way to just iterate over all the notes in a script and dump them out. Well that IS, sorta what the interactive editor is doing (one at a time).
It looks like theCode: [Select]df.global.ui.waypoints.points"thing" (native C++ structure) needs to be transformed into a lua table, for the data to be extracted ?
I've copied theCode: [Select]pushTargetfunction to a new file, and I'm trying to get it work "non-interactively", but I'm still "groping in the dark"
Although the thing is a native c++ structure, the lua bindings are so flexible that usually you don't care. Depends on what you want to print, but it can be as simple as:
Code: [Select]
for i,point in ipairs(df.global.ui.waypoints.points) do
print(point.id,point.name,point.comment)
end