Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Experienced dev, modding newbie: How can I extract "Thoughts & Prefs" text?  (Read 545 times)

Tonren

  • Bay Watcher
    • View Profile

I'm writing a game diary with lots of screenshots, but the wide text on Thoughts and Preferences and other screens is a huge hassle. Total non-starter on mobile, very labor-intensive to stitch together sentences split into multiple lines, and so on.

Can anyone recommend a good starting point for scripting/modding where I could dive in and figure out how to extract this text? I'm most familiar with Ruby, Python and JavaScript; C's all right too. I've been coding for twenty years, but I've actually never looked into this sort of work (modding, reverse engineering, etc), so I don't really know where to start.

It would be great if someone had, like, a hacky Python script that just pulls some text out of memory, so I can hit the ground running and figure it out from there.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile

Uh, if it was 40.24 I'd go check with gm-editor what the exact path was, but df.global.world.units[k].status.current_soul.personality.thoughts and blah.current_soul.preferences could both be pulled with lua and rearranged into a different list format.
Logged

Tonren

  • Bay Watcher
    • View Profile

Thanks Max! (My name's Max too. High five) gm-editor is exactly the kind of thing I was hoping someone would mention; I didn't know it existed before you mentioned it just now, even though I've pored over the DFHack manual many times. It's too bad my C++ is so weak, or I could try to dip into the DFHack code and figure out just the chunks of the API that gm-editor uses. Maybe I'll give it a shot anyway. I don't follow DFHack itself, so I have no clue how long it's supposed to be until a 42-compatible version is released.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist

You can download forumdwarves, a dfhack script, but I dont know if it works with the latest version. It's included in MasterworkDF in the DwarfFortress/hack/scripts folder. It can extract any ingame text and posts it in the correct format for the forum.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

AFAIK the latest DFHack versions (for 40.24) come with both forum-dwarves and a variant that emits markdown for redit.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Tonren

  • Bay Watcher
    • View Profile

These are exactly what I'm looking for! Oh, but I've already started my game on 0.42.03! Maybe I can help the DFHack crew get things updated. When I have some free time I'll at least download them and see if they almost-work with 42. Thanks so much for the suggestions.
Logged