Hi, I have some problems using the DFHack's export-dt-ini script. Maybe I should ask on DFHack thread, but since it is a DT specific script, I hope there is someone understanding it well reading this thread.
I was trying to see I could make DanFritz version work on Windows 64bits and it seems that the offset generated by the script where wrong. The value of "rdelta" was wrong (truncated I guess), replacing the value with the base address from DT gave the proper offsets.
Then I remembered that I was using an old beta of DFHack, and
the internal getRebaseDelta should use a 64 bits value already, so I updated to the latest release. But it did not work. I deleted the "hack" folder before extracting the one from the new version again to make sure I get only updated files.
I got errors from these two lines:
address('knowledge_category',df.activity_event_ponder_topicst,'knowledge_category')
address('knowledge_flag',df.activity_event_ponder_topicst,'knowledge_flag')
Each line give this error:
E:\Games\Dwarf Fortress\hack\lua\memscan.lua:309: Cannot reference field activity_event_ponder_topicst.knowledge_category: not found.
stack traceback:
[C]: in method '_field'
E:\Games\Dwarf Fortress\hack\lua\memscan.lua:309: in function 'memscan.field_ref'
...ames\Dwarf Fortress/hack/scripts/devel/export-dt-ini.lua:54: in local 'address'
I commented them, but the offsets are still wrong because of "rdelta".
Is this a real bug or did I do something wrong with my dfhack install?
PleaseBugMeNot's DT seems to use the invalid addresses. I guess there is some kind of weird hack to fix them in this version, because
the ones I get with a fixed rdelta almost work with my own build of DanFritz's version (I am missing the names, but the skills work).
By the way, a few remarks on DT code:
- Return values from ReadProcessMemory and WriteProcessMemory are not checked.
- get_last_error does not work if something is logged before calling it (printing overwrites the error code).
- MemoryLayout::read_hex reads 32 bits values (not critical since the proper offsets fit in 32 bits, but the invalid ones were not read correctly).