Starting a side thread because there was some interest from a few people in helping with the continued development of Dwarf Therapist.
I'll use this thread to publish some of the basics about the code base and discuss development path.
DwarfTherapist Offsets BootcampBasically, you start by crafting a particular save game - I typically have a dedicated folder for DT development and create games as follows:
- Generate a pocket world.
- Embark at the first location, and choose "Prepare for journey carefully"
- Give the first dwarf (embark leader) level 10 in mining and teaching.
- Customize the first dwarf to have a nickname of this_is_a_long_name and a custom profession of 0123456789abcdef.
- Then embark and pause the game
- Open the [M]ilitary screen, [C]reate a new squad, and assign the first dwarf (now named 'this_is_a_long_name') as the leader
After following these steps, you can then find the offsets using therapist. If it's just a minor update to DF, you can use the Create New Layout functionality from the Scan Memory screen. This will automatically scan all of the vectors and create a new memory offsets ini file for you (if all goes well.) Otherwise you have to check run.log for the new checksum, and start hand editing a new offsets ini file.
- Translation Vector - Finds the language and translation vector
- If DwarfTherapist is having trouble finding this vector, you can search for the C String ABBEY, and do 2(?) reverse lookups to find the vector, then subtract 4 from that address and use the enumerate vector tool to find out how many entries there should be.
- Once you know how many entries there should be, update game_data.ini with that value.
- I'll add more details to this soon (and modify DT to do this automatically if it doesn't find a vector of the expected size)
- Dwarf Race Index - DT has been modified so it should be better at finding this regardless of the expected dwarf race id.
- Creature Vector - This one should always work as long as the nickname offset is correct in game_data.ini
- Squad Vector - This one should always work as long as you have the expedition leader assigned to a squad by himself
I'll add notes on additional methods of finding these offsets and the dwarf offsets, etc, in the future.